/** * WWPP: Show correct wholesale prices in the Elementor side cart. */ // Recalculate cart totals before mini-cart renders to ensure fresh pricing data. add_action( ‘woocommerce_before_mini_cart’, function () { if ( WC()->cart instanceof WC_Cart && ! WC()->cart->is_empty() ) {…Continue reading
/** * Route logout through home URL to prevent exposing the hidden login path. */ add_filter( ‘logout_url’, function ( $logout_url, $redirect ) { $redirect_to = $redirect ?: home_url( ‘/’ ); return add_query_arg( [ ‘do_logout’ => ‘1’, ‘_wpnonce’ => wp_create_nonce( ‘safe-logout’…Continue reading
// WooCommerce Wholesale Prices Premium × WPML — bulk sync wholesale prices to translated products. // Add to functions.php. Visit: /wp-admin/?wwp_wpml_sync=1 as admin. Remove after use. add_action( ‘init’, function () { if ( ! current_user_can( ‘manage_options’ ) || empty( $_GET[‘wwp_wpml_sync’]…Continue reading
/* WWPP – Add the “MSRP” or “MAP” label to the regular price for wholesale customers */ add_action( ‘wp_head’, function() { global $wc_wholesale_prices_premium; $user_wholesale_role = $wc_wholesale_prices_premium->wwpp_wholesale_roles->getUserWholesaleRole(); if ( !empty( $user_wholesale_role ) ) { echo ‘ ‘; } });Continue reading
// // // ADMIN UI: HIDE ACF FIELDS WITH CLASS u-dnone // Allows specific ACF fields to be conditionally hidden in the editor by assigning them the // u-dnone class via field settings. Useful for internal or deprecated fields that…Continue reading
// // // SECURITY: DISABLE XML-RPC // XML-RPC is a legacy WordPress remote access protocol that is rarely needed on modern sites. // It is a common vector for brute-force and DDoS amplification attacks. This filter disables it // entirely,…Continue reading
add_action(‘wp_head’, function() { if (!is_admin_bar_showing()) return; ?>Continue reading
/** * Suppress WWP’s per-item cart recalculation during Wholesale Order Form batch adds. * Defers to a single recalculation at the end of each batch request instead. * * Add to functions.php or a mu-plugin. * Requires: Wholesale Prices 2.2.8+,…Continue reading