NoCache
/** * Disable caching ONLY for the margin calculator page. * Put this in its own WPCode PHP snippet set to Auto Insert -> Run Everywhere. */ add_action(‘send_headers’, function () { // Skip admin + ajax + REST if (is_admin()…Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
/** * Disable caching ONLY for the margin calculator page. * Put this in its own WPCode PHP snippet set to Auto Insert -> Run Everywhere. */ add_action(‘send_headers’, function () { // Skip admin + ajax + REST if (is_admin()…Continue reading
/** * Remove WC Vendors “Apply to become a vendor” checkbox from the WooCommerce default customer signup form. */ add_action( ‘init’, ‘wcv_remove_vendor_registration_checkbox’, 99 ); function wcv_remove_vendor_registration_checkbox() { global $wp_filter; $hook = ‘woocommerce_register_form’; if ( isset( $wp_filter[ $hook ] ) )…Continue reading
add_action(‘admin_init’, function () { // Redirect any user trying to access comments page global $pagenow; if ($pagenow === ‘edit-comments.php’) { wp_safe_redirect(admin_url()); exit; } // Remove comments metabox from dashboard remove_meta_box(‘dashboard_recent_comments’, ‘dashboard’, ‘normal’); // Disable support for comments and trackbacks in…Continue reading
add_action( ‘init’, function() { $branding = get_field( ‘branding’, ‘option’ ); if ( empty( $branding ) ) { return; } $background = sanitize_hex_color( $branding[‘background’] ?? ” ) ?: ‘transparent’; $primary = sanitize_hex_color( $branding[‘primary’] ?? ” ) ?: ‘inherit’; $secondary = sanitize_hex_color(…Continue reading
/** * Plugin: Pipeline Unified Sync * Purpose: Ensure WP All Import runs from cron and reduce server load. * Add as WPCode “PHP Snippet” and activate. */ // Ensure WPAI runs when cron hits (don’t skip on feed check)…Continue reading
add_action( ‘init’, function() { $branding = get_field( ‘branding’, ‘option’ ); if ( empty( $branding ) ) { return; } $background = sanitize_hex_color( $branding[‘background’] ?? ” ) ?: ‘transparent’; $primary = sanitize_hex_color( $branding[‘primary’] ?? ” ) ?: ‘inherit’; $secondary = sanitize_hex_color(…Continue reading
add_filter( ‘wpforms_geolocation_forms_field_get_map_field_settings’, ‘wpf_geolocation_forms_field_get_map_field_settings’, 10, 3 ); function wpf_geolocation_forms_field_get_map_field_settings( $settings, $field, $form_data ): array { $settings = (array) $settings; if ( empty( $form_data[‘id’] ) ) { return $settings; } if ( (int) $form_data[‘id’] !== 111 ) { // TODO: Change 111…Continue reading
add_shortcode(‘fw_row_filter’, function($atts, $content = null) { if (!$content) return ”; // Set up the incoming data variables $atts = shortcode_atts(array( ‘filter’ => ‘all’, ‘rvw_exp’ => ”, ‘fw_exp’ => ”, ‘bday1’ => ”, ‘bday2’ => ” ), $atts); $filter = sanitize_text_field($atts[‘filter’]);…Continue reading
/** * Multisite Snippet Debug Badge (Front-end + Admin) * – Shows a visible badge proving the snippet is executing on that site * – Includes blog/site IDs + domain for quick verification * * Add as a WPCode snippet.…Continue reading
// Project form – First field dynamic (ID = 100) add_filter( ‘gform_pre_render’, ‘byus_populate_aap_select_field’ ); add_filter( ‘gform_pre_validation’, ‘byus_populate_aap_select_field’ ); add_filter( ‘gform_pre_submission_filter’, ‘byus_populate_aap_select_field’ ); add_filter( ‘gform_admin_pre_render’, ‘byus_populate_aap_select_field’ ); function byus_populate_aap_select_field( $form ) { $aap_mode_enabled = get_field( ‘aap_mode_enabled’, ‘option’ ); $current_aap = get_field(…Continue reading