This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function change_author_capabilities() { | |
$role = get_role( 'shop_vendor' ) ; | |
$role->add_cap( 'delete_products' ); | |
} | |
add_action( 'admin_init', 'change_author_capabilities' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function pw_rcp_earnings_slash_command() { | |
# Check to make sure this is a Slash Command Request | |
if ( ! isset( $_REQUEST['slack_slash'] ) && 'your_custom_string' != $_REQUEST['slack_slash'] ) | |
return false; | |
# Check to see if a token has been passed as well | |
if ( ! isset( $_REQUEST['token'] ) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'mailchimp_sync_subscriber_data', function( MC4WP_MailChimp_Subscriber $subscriber, $user ) { | |
$affiliate = affiliate_wp()->affiliates->get_by( 'user_id', $user->ID ); | |
if( ! empty( $affiliate ) ) { | |
$subscriber->merge_fields['MERGE6'] = $affiliate->affiliate_id; | |
} | |
return $subscriber; | |
}, 10, 2 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function custom_prefix_warn_about_old_refunds_js() { | |
if ( ! isset( $_GET['prevent_accidental_refunds_js'] ) ) { | |
return false; | |
} | |
header('Content-Type: application/javascript'); | |
?> |
OlderNewer