This file contains hidden or 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_edd_purchase_form_required_fields( $required_fields ) { | |
unset( $required_fields['edd_first'] ); | |
return $required_fields; | |
} | |
add_filter( 'edd_purchase_form_required_fields', 'pw_edd_purchase_form_required_fields' ); |
This file contains hidden or 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 | |
/* | |
* Plugin name: Affiliate role on registration | |
*/ | |
function pw_affwp_set_role_on_registration( $affiliate_id = 0 ) { | |
$user_id = affwp_get_affiliate_user_id( $affiliate_id ); | |
$user = new WP_User( $user_id ); | |
$user->add_role( 'affiliate' ); |
This file contains hidden or 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 | |
/* | |
* Plugin Name: Restrict Content Pro - OntraPort Referral Tracking | |
* Description: Very basic referral tracking for onraport and Restrict Content Pro | |
*/ | |
function pw_rcp_ontraport_referrals( $payment_id, $args, $amount ) { | |
global $rcp_options; |
This file contains hidden or 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_update_role_status_change( $new_status, $user_id ) { | |
switch( $new_status ) { | |
case 'expired' : | |
case 'pending' : | |
case 'free' : | |
case 'cancelled' : |
This file contains hidden or 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 rcp_add_member_caps() { | |
// gets the editor role | |
$role = get_role( 'editor' ); | |
// Allow Editors to view Members in Restrict Content Pro | |
$role->add_cap( 'rcp_view_members' ); | |
} |
This file contains hidden or 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 | |
/* | |
* Plugin Name: EDD Redirect to Next Product on Add to Cart | |
* Description: Automatically redirects the customer to the next product after they have added an item to the cart | |
* Author: Pippin Williamson | |
* Version: 0.1 | |
*/ | |
function pw_edd_redirect_to_next_scripts( $download_id = 0 ) { |
This file contains hidden or 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_edd_maybe_disable_stripe( $gateways ) { | |
$disable = false; | |
$cart_items = edd_get_cart_contents(); | |
if( $cart_items ) { | |
foreach( $cart_items as $item ) { |
This file contains hidden or 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_login_redirect( $redirect_to, $request, $user ) { | |
$status = rcp_get_status( $user->ID ); | |
switch( $status ) { | |
case 'expired' : | |
case 'pending' : |
This file contains hidden or 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_update_role_status_change( $new_status, $user_id ) { | |
$role = false; | |
switch( $new_status ) { | |
case 'expired' : | |
case 'pending' : |
This file contains hidden or 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' ); |