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 | |
add_action( 'admin_footer', function() { | |
$screen = get_current_screen(); | |
if ( 'pretty-link' == $screen->id ) { | |
?> | |
<script type="text/javascript"> |
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 | |
global $prli_link, $prli_blogurl; | |
// Create the pretty link | |
$pretty_link_id = prli_create_pretty_link( | |
'https://google.com', // Target URL | |
'api-link-1', // Slug | |
'API Link', // Name of pretty link | |
'', // Description |
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 mepr_trial_num_days() { | |
$user_id = get_current_user_id(); | |
$content = ''; | |
if ( 0 == $user_id ) { | |
return; | |
} |
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 | |
add_filter('mepr_paypal_subcription_args', function($args, $sub) { | |
$args['application_context']['shipping_preference'] = 'SET_PROVIDED_ADDRESS'; | |
$args['subscriber']['shipping_address']['address']['address_line_1'] = get_user_meta($sub->user_id, 'mepr-address-one', true); | |
$args['subscriber']['shipping_address']['address']['admin_area_2'] = get_user_meta($sub->user_id, 'mepr-address-city', true); | |
$args['subscriber']['shipping_address']['address']['admin_area_1'] = get_user_meta($sub->user_id, 'mepr-address-state', true); | |
$args['subscriber']['shipping_address']['address']['postal_code'] = get_user_meta($sub->user_id, 'mepr-address-zip', true); | |
$args['subscriber']['shipping_address']['address']['country_code'] = get_user_meta($sub->user_id, 'mepr-address-country', true); | |
$args['subscriber']['shipping_address']['name']['full_name'] = get_user_meta($sub->user_id, 'nickname', true); |
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 customize_admin_members_cols($cols) { | |
$cols['col_business_name'] = __('Business Name', 'memberpress'); | |
$cols['col_dealer_affiliation'] = __('Dealer Affiliation', 'memberpress'); | |
$cols['col_department'] = __('Department', 'memberpress'); | |
$cols['col_job_title'] = __('Job Title', 'memberpress'); | |
$cols['col_user_type'] = __('User Type', 'memberpress'); | |
return $cols; | |
} |
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 | |
if(MeprUtils::is_post_request() && isset($_POST['mpca_send_welcome_emails'])) { | |
$ca = MPCA_Corporate_Account::find_by_uuid($_REQUEST['ca']); | |
$sub_users = $ca->sub_users(); | |
foreach($sub_users as $sub_user) { | |
$txn = $ca->get_user_sub_account_transaction($sub_user->ID); |
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 mepr_remove_subscriber_role($roles_to_remove, $wp_user) { | |
$mepr_user = new MeprUser($wp_user->ID); | |
// Remove the default role in all cases. | |
$roles_to_remove[] = 'spectator'; | |
if (mepr_is_member_inactive($mepr_user)) { | |
$roles_to_remove[] = 'subscriber'; | |
} else { |
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 if(!defined('ABSPATH')) {die('You are not allowed to call this page directly.');} ?> | |
<style> | |
.mpcs-course-thumbnail { | |
vertical-align: middle; | |
} | |
.grid .col-1-2:last-of-type { | |
padding-top: 50px; | |
} | |
</style> |
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 | |
add_action('init', function() { | |
$users = MeprUser::all(); | |
$ca_obj_ids = array(); | |
$duplicates = array(); | |
foreach($users as $user) { | |
$corporate_accounts = MPCA_Corporate_Account::get_all_by_user_id($user->ID); |
NewerOlder