Completely Disable Comments

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

Pcb twin merge v2.8

/* ============================================================ PCBoost Twin Merge v2.8 (WPCode snippet — PHP, Run Everywhere) INSTALL: paste over the WHOLE code of snippet 145988 (same snippet, Update), together with Delivery lead times v1.6 (191496). Never run two Twin Merge versions side by side…Continue reading

Pcb eu arrival dates

/* ============================================================ PCBoost — EU arrival dates (add to the EU Shipping Gate snippet, or paste as its own snippet — it only needs pcb_cart_has_extended_dispatch() which already lives in the EU Shipping Gate snippet). When the cart contains an Extended…Continue reading

EU Shipping Gate

/* PCBoost — EU Shipping Gate Hides Express Next Day + Fast Delivery when the cart contains any item on the ‘extended-dispatch’ shipping class (5–7 day EU stock). */ function pcb_cart_has_extended_dispatch() { if ( ! WC()->cart ) { return false;…Continue reading

Pcb twin merge v2 5 latter for faster stock updates/ prices

/* ============================================================ PCBoost Twin Merge v2.5 (WPCode snippet — PHP, Run Everywhere) v2.2 changes on top of v2.1: • Keeps the ‘extended-dispatch’ shipping class in sync with the active tier (set when active source is eu-5-7, cleared when next-day) —…Continue reading

PCBoost — Collapse optional UPS

/* ============================================================ PCBoost — Collapse optional UPS component behind a toggle (WPCode PHP snippet, or add to functions.php) Targets the Power Protection (UPS) component by its component_id (1780838418) so it doesn’t affect the drive/installation selectors. On the product page the…Continue reading

PCBoost — Sticky Add to Cart bar

/* ============================================================ PCBoost — Sticky bottom Add-to-Cart bar (product pages) Appears when the real Add-to-basket button scrolls out of view; hides when it’s back in view. Simple products: the sticky button clicks the REAL button (respects qty/AJAX). Composite kits: the…Continue reading

PCBoost — contact form

/** * PCBoost — contact form handler (no plugin). * Receives the form via admin-ajax (cache-immune) and emails [email protected]. * WPCode: PHP Snippet, Location = Run Everywhere. Or functions.php. */ add_action( ‘wp_ajax_pcb_contact’, ‘pcb_contact_handler’ ); add_action( ‘wp_ajax_nopriv_pcb_contact’, ‘pcb_contact_handler’ ); function pcb_contact_handler()…Continue reading

Related products – hide out of stock

/* PCBoost – Related products: in-stock only (v2, replaces 186358) */ /* 1. Query level: the candidate pool is built only from in-stock products */ add_filter( ‘woocommerce_product_related_posts_query’, ‘pcb_related_instock_query’, 20, 2 ); function pcb_related_instock_query( $query, $product_id ) { global $wpdb; $lookup…Continue reading