add_action(‘created_category’, ‘auto_add_category_to_primary_theme_menu’, 10, 2); function auto_add_category_to_primary_theme_menu($term_id, $tt_id) { // Get menu assigned to the “primary” theme location $locations = get_nav_menu_locations(); if (!isset($locations[‘primary’])) return; $menu_id = $locations[‘primary’]; $category = get_category($term_id); if (!$category || is_wp_error($category)) return; // Prevent duplicates $items = wp_get_nav_menu_items($menu_id);…Continue reading
/** * For the Accordion Template, this is a helper script * * For support, please visit: https://www.facebook.com/groups/wpformsvip */ add_action( ‘wp_head’, function () { ?>Continue reading
function mobile_menu_shortcode( $atts ) { $atts = shortcode_atts( array( ‘menu_id’ => ”, // Optional menu ID ‘svg_url’ => ”, // Optional SVG URL for submenu toggle icon ), $atts, ‘mobile_menu’ ); // If no menu ID provided, get the first…Continue reading
// 1. Show pickup date after shipping & before tax/totals add_action(‘woocommerce_review_order_after_shipping’, ‘custom_pickup_date_field’); function custom_pickup_date_field() { $tomorrow = date(‘Y-m-d’, strtotime(‘+1 day’)); ?> *Continue reading
function wpexpert28_hide_shipping_when_free_is_available( $rates ) { $free_shipping = array(); // Loop through each shipping rate foreach ( $rates as $rate_id => $rate ) { // Check if the shipping method is Free Shipping if ( ‘free_shipping’ === $rate->get_method_id() ) { $free_shipping[…Continue reading
add_filter(‘woocommerce_shipping_methods’, ‘register_wholesale_shipping_method’); function register_wholesale_shipping_method($methods) { $methods[‘wholesale_shipping’] = ‘WC_Shipping_Wholesale’; return $methods; } if (!class_exists(‘WC_Shipping_Wholesale’)) { class WC_Shipping_Wholesale extends WC_Shipping_Method { public function __construct($instance_id = 0) { $this->id = ‘wholesale_shipping’; $this->instance_id = absint($instance_id); $this->method_title = __(‘Wholesale Shipping’); $this->method_description = __(‘Flat rate shipping…Continue reading
// 💡 Load multiselect field to all shipping methods add_action(‘woocommerce_init’, ‘woocommerce_shipping_instances_form_fields_filters’); function woocommerce_shipping_instances_form_fields_filters() { foreach (WC()->shipping->get_shipping_methods() as $shipping_method) { add_filter(‘woocommerce_shipping_instance_form_fields_’ . $shipping_method->id, ‘add_allowed_roles_field_to_shipping_methods’); } } // 🎯 Add multiselect role option (styled like tag input) function add_allowed_roles_field_to_shipping_methods($settings) { $settings[‘allowed_user_roles’] =…Continue reading
function evocalux_user_static_test() { return ‘ It works! 💥 ‘; } add_shortcode(‘test_this’, ‘evocalux_user_static_test’);Continue reading
function evocalux_user_debugger_shortcode() { return ‘ ✨ Shortcode is working ✨ ‘; } add_shortcode(‘evocalux_user’, ‘evocalux_user_debugger_shortcode’);Continue reading