MemberPress: Set Custom Product Pages

function mepr_is_product_page( $return, $post ) { $custom_pages = array( 1, 2, 3 ); //Replace these numbers with the post ID’s of the pages if( isset( $post ) && in_array( $post->ID, $custom_pages ) ) { return true; } return $return; }…Continue reading

MemberPress: Disable Address Fields for a Specific Membership

function mepr_disable_address_fields( $fields ) { if ( is_single( array( 12, 564 ) ) ) { $hide_fields = array( ‘mepr-address-state’, ‘mepr-address-zip’, ‘mepr-address-one’, ‘mepr-address-two’, ‘mepr-address-city’, ‘mepr-address-country’, ); foreach ( $fields as $key => $field ) { if ( isset( $field->field_key ) &&…Continue reading

MemberPress: Pass a Member Phone Number to Stripe

function mepr_pass_phone_number_to_stripe( $args, $user ) { $phone = get_user_meta( $user->ID, ‘mepr_phone’, true ); if ( ! empty( $phone ) ) { $args[‘phone’] = $phone; } return $args; } add_filter( ‘mepr_stripe_create_customer_args’, ‘mepr_pass_phone_number_to_stripe’, 10, 2 );Continue reading

Exclude a Specific Term from the Sitemap

add_filter( ‘aioseo_sitemap_exclude_terms’, ‘aioseo_sitemap_filter_excluded_terms’, 10, 2 ); function aioseo_sitemap_filter_excluded_terms( $ids, $type ) { if ( ‘general’ === $type ) { $ids[] = 412; } return $ids; }Continue reading

Exclude a Specific Post from the Sitemap

add_filter( ‘aioseo_sitemap_exclude_posts’, ‘aioseo_sitemap_filter_excluded_posts’, 10, 2 ); function aioseo_sitemap_filter_excluded_posts( $ids, $type ) { if ( ‘general’ === $type ) { $ids[] = 614; } return $ids; }Continue reading

Append a Page to the Additional Pages Sitemap

add_filter( ‘aioseo_sitemap_additional_pages’, ‘aioseo_sitemap_add_additional_pages’ ); function aioseo_sitemap_add_additional_pages( $pages ) { $pages[] = [ ‘loc’ => ‘https://example.com/additional-page’, ‘lastmod’ => ‘2020-12-11 11:11’, ‘changefreq’ => ‘always’, ‘priority’ => (float) 1.0 ]; return $pages; }Continue reading

Dynamically Add Article Schema to Posts

add_filter( ‘aioseo_schema_graphs’, ‘aioseo_filter_schema_graphs’ ); function aioseo_filter_schema_graphs( $graphs ) { if ( is_singular( ‘post’ ) && ! in_array( ‘Article’, $graphs, true ) ) { $graphs[] = ‘Article’; } return $graphs; }Continue reading

Disable Schema Output for WooCommerce products

add_filter( ‘aioseo_schema_disable’, ‘aioseo_disable_schema_products’ ); function aioseo_disable_schema_products( $disabled ) { if ( is_singular( ‘product’ ) && aioseo()->helpers->isWooCommerceActive() ) { return true; } return $disabled; }Continue reading