Create a Custom Shipping Method in WooCommerce

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

WooCommerce: Restrict Shipping Methods by User Role (Logged In, Logged Out, Custom Roles)

// 💡 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

Evocalux Static Test

function evocalux_user_static_test() { return ‘ It works! 💥 ‘; } add_shortcode(‘test_this’, ‘evocalux_user_static_test’);Continue reading

EvocaLux Shortcode Debugger2

function evocalux_user_debugger_shortcode() { return ‘ ✨ Shortcode is working ✨ ‘; } add_shortcode(‘evocalux_user’, ‘evocalux_user_debugger_shortcode’);Continue reading

[clinical_pilot]

/** * 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

Display Roster Entry

/** Display Roster Entry **/ // FOR DEBUGGING ONLY //$data = serialize(array(“Red”, “Green”, “Blue”)); //echo $data . ““; // //$test = unserialize($data); //var_dump($test); // $profile_id = um_profile_id(); $user = get_user($profile_id); $email = $user->email; //FOR DEBUGGING ONLY: // $email = “[email protected]”;…Continue reading

EvocaLux: Display Logged-In Username

function evocalux_display_username() { if ( is_user_logged_in() ) { $current_user = wp_get_current_user(); return esc_html( $current_user->display_name ); } else { return ‘beautiful soul’; } } add_shortcode( ‘user_name’, ‘evocalux_display_username’ );Continue reading

EvocaLux User Variable

function evocalux_display_username() { $current_user = wp_get_current_user(); if ( is_user_logged_in() && ! empty( $current_user->display_name ) ) { return esc_html( $current_user->display_name ); } else { return ‘beautiful soul’; } } add_shortcode(‘user_name’, ‘evocalux_display_username’);Continue reading

Display the Last Updated Date

$u_time = get_the_time( ‘U’ ); $u_modified_time = get_the_modified_time( ‘U’ ); // Only display modified date if 24hrs have passed since the post was published. if ( $u_modified_time >= $u_time + 86400 ) { $updated_date = get_the_modified_time( ‘Y-m-d’ ); $updated_time =…Continue reading

Máscara CPF 2

// Carrega a biblioteca Inputmask var script = document.createElement(‘script’); script.src = “https://cdnjs.cloudflare.com/ajax/libs/jquery.inputmask/5.0.8/jquery.inputmask.min.js”; script.onload = function () { aplicarMascaraCPF(); }; document.head.appendChild(script); // Função que aplica a máscara e a validação no campo CPF function aplicarMascaraCPF() { if (typeof jQuery === ‘undefined’…Continue reading