Template: After Order Actions

/* * Process non-critical tasks after an order has been completed. * * This runs ~30 seconds after a purchase is completed via WP_Cron. * * @param int $order_id The Order ID that was marked as completed. * @param \EDD\Orders\Order…Continue reading

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