Dynamic Copyright Date

if ( ! function_exists( ‘wpb_copyright’ ) ) { function wpb_copyright() { // Cache the output so we don’t have to run the query on every page load. $output = get_transient( ‘wpb_copyright_text’ ); if ( false !== $output ) { //…Continue reading

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