add_action(‘save_post’, ‘check_and_add_categories_to_menu’, 20, 3); function check_and_add_categories_to_menu($post_id, $post, $update) { // Only run for posts and prevent autosaves if (wp_is_post_autosave($post_id) || wp_is_post_revision($post_id) || $post->post_type !== ‘post’) { return; } $locations = get_nav_menu_locations(); if (!isset($locations[‘primary’])) return; $menu_id = $locations[‘primary’]; $menu_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
/** * Plugin Name: Clinical Pilot – Main (Toggle Fields) * Description: Provides [clinical_pilot] with a toggle for structured (4 fields) vs. all-in-one input, plus a complete specialty list. Preserves vitals, AI Preferences, technical summary, and rating block. No logs.…Continue reading
add_filter( ‘wpcode_smart_tags’, function( $tags ) { $tags[‘custom’] = array( ‘label’ => ‘Custom’, ‘tags’ => array( ‘custom_field_tag’ => array( ‘label’ => ‘Custom Field Tag’, ‘function’ => ‘wpcode_custom_field_tag’, ), ), ); return $tags; } ); function wpcode_custom_field_tag() { // Replace custom_field_tag below…Continue reading
function custom_purchase_info_shortcode() { global $wpdb; // Get the current user ID $user_id = get_current_user_id(); // Get the latest MemberPress transaction for this user $latest_transaction = $wpdb->get_row( $wpdb->prepare( “SELECT * FROM {$wpdb->prefix}mepr_transactions WHERE user_id = %d ORDER BY id DESC LIMIT…Continue reading