MemberPress: Adding Credit Card and Expiry Information to Subscriptions Table
// Add the “Card/Expiry” column header function mepr_add_subscriptions_th($user, $subs) { ?> Card/ExpiryContinue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
// Add the “Card/Expiry” column header function mepr_add_subscriptions_th($user, $subs) { ?> Card/ExpiryContinue reading
add_action(‘wp_footer’, function() { ?>Continue reading
add_action(‘wp_head’, function() { ?>Continue reading
/** * Display featured images of the current user’s active memberships * Add the [membership_thumbnail] shortcode to display the featured images of all active memberships of the current user. */ function custom_membership_thumbnail_shortcode() { if ( !is_user_logged_in() ) return; $user =…Continue reading
add_filter( ‘mepr_custom_cancel_link’, function( $link, $sub ) { // Get the subscription start time as a timestamp $subscription_start = strtotime( $sub->created_at ); // Get the current time as a timestamp $current_time = time(); // Calculate the number of months passed since…Continue reading
function mp_membership_renewal_date() { if (!is_user_logged_in()) { return ‘You need to be logged in to view this information.’; } global $wpdb; $user_id = get_current_user_id(); // Query to get all active MemberPress transactions for the current user $transactions = $wpdb->get_results($wpdb->prepare( “SELECT txn.*,…Continue reading
function mp_membership_status() { if (!is_user_logged_in()) { return ‘You need to be logged in to view this information.’; } global $wpdb; $user_id = get_current_user_id(); // Query to get all active MemberPress transactions for the current user $transactions = $wpdb->get_results($wpdb->prepare( “SELECT txn.*,…Continue reading
function mp_custom_membership_info() { if (!is_user_logged_in()) { return ‘You need to be logged in to view this information.’; } global $wpdb; $user_id = get_current_user_id(); // Query to get all active MemberPress transactions for the current user $transactions = $wpdb->get_results($wpdb->prepare( “SELECT txn.*,…Continue reading
function mepr_account_nav_courses_link($link) { if (current_user_can(‘administrator’)) { // Set the user-role-based condition return ‘/admin-courses/’; // If the user matches the user-role-based condition, apply this URL } else { return ‘/user-courses/’; // If the user DOESN’T match the user-role-based condition, apply this…Continue reading
function mepr_account_nav_courses_link($link) { // Change the link URL from the default to the new courses URL return ‘/courses/’; } add_filter(‘mepr-account-nav-courses-link’, ‘mepr_account_nav_courses_link’);Continue reading