MemberPress: Rearranging Navigation Items On The Account Page
add_action(‘wp_head’, function() { ?>Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
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 avia_remove_wc_currency_symbol( $currency_symbol, $currency ) { $currency_symbol = ”; if ( is_cart() || is_checkout() || is_wc_endpoint_url(‘order-received’)) $currency_symbol = ‘€’; return $currency_symbol; } add_filter(‘woocommerce_currency_symbol’, ‘avia_remove_wc_currency_symbol’, 10, 2);Continue reading
document.addEventListener(‘om.Campaign.afterShow’, function (event) { if (‘{{id}}’ !== event.detail.Campaign.id) { return; } var closeAfter = 8000; // delay set at 8 seconds, edit time to your liking setTimeout(function () { event.detail.Campaign.startClose(); }, closeAfter); });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