Location: everywhere
MemberPress: Unsubscribed Memberships Shortcode
add_shortcode( ‘mepr-unsubscribed-memberships’, function () { $args = array( ‘post_type’ => ‘memberpressproduct’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => -1, ); $memberships = new WP_Query( $args ); ob_start(); if ( $memberships->have_posts() ) { echo ‘ ‘; while ( $memberships->have_posts() ) { $memberships->the_post(); $post_ID…Continue reading
MemberPress: Restrict Signups for US-Based Users
function limit_signups_to_excluded_regions( $errors ) { // Check if the country field is set If ( isset( $_POST[ ‘mepr-address-country’ ] ) ) { $country = sanitize_text_field( wp_unslash( $_POST[ ‘mepr-address-country’ ] ) ); // Exclude EU countries if ( $country == ‘US’…Continue reading
MemberPress: Restrict Signups for EU-Based Users
function limit_signups_to_excluded_regions( $errors ) { // List of EU country codes $eu_countries = array( ‘AT’, ‘BE’, ‘BG’, ‘HR’, ‘CY’, ‘CZ’, ‘DK’, ‘EE’, ‘FI’, ‘FR’, ‘DE’, ‘EL’, ‘HU’, ‘IE’, ‘IT’, ‘LV’, ‘LT’, ‘LU’, ‘MT’, ‘NL’, ‘PL’, ‘PT’, ‘RO’, ‘SK’, ‘SI’, ‘ES’,…Continue reading
MemberPress: Restrict Signups for Northern Ireland-Based Users
function limit_signups_to_excluded_regions($errors) { // Check if the country field is set if ( isset( $_POST[ ‘mepr-address-country’ ] ) ) { $country = sanitize_text_field( wp_unslash( $_POST[ ‘mepr-address-country’ ] ) ); // Exclude Northern Ireland under UK country code if( $country ==…Continue reading
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
MemberPress: Move “Upgrade” Button to after Subscriptions Tab
add_action(‘wp_footer’, function() { ?>Continue reading
MemberPress: Rearranging Navigation Items On The Account Page
add_action(‘wp_head’, function() { ?>Continue reading
Featured Images of the Current User’s All Active Memberships
/** * 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
Check Appointments Table Data – PHP
/** * Check Appointments Table Data * Author: Sumaiya, Clickup Doc: https://app.clickup.com/36636088/v/dc/12y1dr-22535/12y1dr-19135 * This PHP function checks the `iks_apt_inspection_db` database table to determine * if any rows of data are present. It returns a simple string response indicating * whether…Continue reading