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

WP Simple Pay: Google GA4 Payment Conversion Tracking

/** * @link https://library.wpcode.com/snippet/j57gxn45/ */ add_action( ‘simpay_payment_receipt_viewed’, /** * Runs the first time the payment confirmation page is viewed. * * @param array $payment_confirmation_data */ function( $payment_confirmation_data ) { // Payment customer data (not used in this example). $customer =…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

Remove Specific Taxonomy From Public Taxonomies List

add_filter( ‘aioseo_public_taxonomies’, ‘aioseo_filter_public_taxonomies’ ); function aioseo_filter_public_taxonomies( $taxonomies ) { $filteredTaxonomies = []; foreach ( $taxonomies as $taxonomiesObject ) { if ( ‘genre’ === $taxonomiesObject[‘name’] ) { continue; } $filteredTaxonomies[] = $taxonomiesObject; } return $filteredTaxonomies; }Continue reading

Remove Specific Post Type From Public Post Type List

add_filter( ‘aioseo_public_post_types’, ‘aioseo_filter_public_post_types’ ); function aioseo_filter_public_post_types( $postTypes ) { $filteredPostTypes = []; foreach ( $postTypes as $postTypeObject ) { if ( is_array( $postTypeObject ) && ‘movie’ === $postTypeObject[‘name’] ) { continue; } $filteredPostTypes[] = $postTypeObject; } return $filteredPostTypes; }Continue reading