Block WPCode Conversion Pixels Facebook

add_filter(‘wpcode_get_snippets_for_location’, function( $snippets, $location) { if ( ‘site_wide_header’ !== $location ) { return $snippets; } // Let’s remove any snippet with the id of pixel_facebook. $snippets = array_filter( $snippets, function( $snippet ) { return ‘pixel_facebook’ !== $snippet->id; } ); return…Continue reading

WordPress – Display the Last Updated Date

$u_time = get_the_time( ‘U’ ); $u_modified_time = get_the_modified_time( ‘U’ ); // Only display modified date if 24hrs have passed since the post was published. if ( $u_modified_time >= $u_time + 86400 ) { $updated_date = get_the_modified_time( ‘F jS, Y’ );…Continue reading

Change “Howdy Admin” in Admin Bar (copy)

function wpcode_snippet_replace_howdy( $wp_admin_bar ) { // Edit the line below to set what you want the admin bar to display intead of “Howdy,”. $new_howdy = ‘Welcome,’; $my_account = $wp_admin_bar->get_node( ‘my-account’ ); if ( ! isset( $my_account->title ) ) { return;…Continue reading

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