Wholesale – Catalog Weld Note (-weld roles)

/** * UNITED PRODUCTS – WHOLESALE CATALOG WELD NOTE * ——————————————— * Shows “Weld & dress added in cart” on archive/catalog/category pages * for logged-in wholesale users whose role contains “-weld”. * * Purpose: * – Gives weld-role customers context…Continue reading

Wholesale – Weld & dress cart fee (by blade width)

/** * Wholesale: Cart weld fee for -weld roles (grouped by blade width) — TAXABLE */ if ( ! function_exists(‘up_user_has_weld_role’) ) { function up_user_has_weld_role(): bool { if ( ! is_user_logged_in() ) return false; $user = wp_get_current_user(); foreach ( (array) $user->roles…Continue reading

Hero LCP Image Priority (Front Page)

add_filter(‘wp_get_attachment_image_attributes’, function ($attr, $attachment, $size) { if ( ! is_front_page() ) return $attr; // Hero background image (ID 6598) if ( isset($attachment->ID) && (int) $attachment->ID === 6598 ) { $attr[‘loading’] = ‘eager’; $attr[‘fetchpriority’] = ‘high’; $attr[‘decoding’] = ‘async’; } return…Continue reading

Disable TT4 webfonts + preload

/** * Nuke TT4 / WP webfonts (Inter & Cardo) from the front end. */ // 1. Stop TT4’s own preload / font-face helper (safety, but not relied on). add_action( ‘after_setup_theme’, function () { remove_action( ‘wp_head’, ‘twentytwentyfour_preload_webfonts’ ); }, 20…Continue reading

WooCommerce Checkout Newsletter Opt-In

// Add opt-in checkbox at checkout (after billing fields) add_action(‘woocommerce_after_checkout_billing_form’, ‘upl_add_newsletter_opt_in_checkbox’, 10); function upl_add_newsletter_opt_in_checkbox($checkout) { woocommerce_form_field(‘subscribe_to_newsletter’, array( ‘type’ => ‘checkbox’, ‘class’ => array(‘form-row-wide’), ‘label’ => __(‘Yes, I want to subscribe to your newsletter’), ‘required’ => false, ), $checkout->get_value(‘subscribe_to_newsletter’)); } //…Continue reading

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