Meta Checkout URL

/** * Handle Meta (Facebook/Instagram Shops) checkout URLs * Format: /checkout?products=wc_post_id_123:2,wc_post_id_456:1&coupon=CODE */ add_action( ‘template_redirect’, function() { if ( ! isset( $_GET[‘products’] ) ) { return; } // Ensure WooCommerce is loaded and cart is available if ( ! function_exists( ‘WC’…Continue reading

Automatically Apply Coupons from Campaigns

/** * WooCommerce: cookie-driven auto-coupon using the coupon’s own restrictions * – URL: ?bllpromo=COUPONCODE -> sets cookie bllpromo=COUPONCODE for 30 days * – If cookie exists and coupon is valid for the current cart (per ALL restrictions), * the coupon…Continue reading

Coming Soon Products

add_filter( ‘woocommerce_get_availability_text’, ‘wsp_custom_coming_soon_text’, 10, 2 ); function wsp_custom_coming_soon_text( $text, $product ) { if ( ! $product ) { return $text; } // Get the correct product ID (parent for variations) $product_id = $product->get_id(); if ( $product->is_type( ‘variation’ ) ) {…Continue reading

Action Scheduler Log Retention

add_filter( ‘action_scheduler_default_cleaner_statuses’, function ( $statuses ) { $statuses[] = ‘failed’; return $statuses; } ); add_filter( ‘action_scheduler_retention_period’, ‘custom_action_scheduler_retention’ ); /** * Change Action Scheduler default purge to 1 day */ function custom_action_scheduler_retention() { return DAY_IN_SECONDS; // DAY_IN_SECONDS is a built-in WordPress…Continue reading

Age Gate Attestation

add_action(‘age_gate/custom/after’, ‘my_custom_fields’); function my_custom_fields() { echo ‘ I agree and understand that certain products on this site are intended for research use only, as defined by the FDA. I also agree to the Research Use Only Policy of this site.‘;…Continue reading

Geo Search Snippet 1 – Mobile

if ( ! function_exists( ‘rw_geo_search_after_header_1280_mobile’ ) ) { add_action( ‘kadence_after_header’, ‘rw_geo_search_after_header_1280_mobile’ ); function rw_geo_search_after_header_1280_mobile() { if ( is_admin() ) { return; } echo ‘ ‘; echo ‘ ‘; echo do_shortcode( ‘[geo_search_mobile]’ ); echo ‘ ‘; echo ‘ ‘; } }Continue reading

Cortex Pages & Posts Meta API (copy)

/** * Cortex Pages & Posts SEO Meta API – REST Endpoints for RankMath SEO Data * v2.2 – Added audit-list endpoint for lightweight content inventory * * For meta titles, descriptions, excerpts, focus keywords, and categories. * Works with…Continue reading

Disable Update Notifications

// Disable plugin update emails add_filter( ‘auto_plugin_update_send_email’, ‘__return_false’ ); // Disable theme update emails add_filter( ‘auto_theme_update_send_email’, ‘__return_false’ ); // Disable core update emails add_filter( ‘auto_core_update_send_email’, ‘__return_false’ );Continue reading