/** * FRS Work Orders per Month (Last 12 Months) * Shortcode: [frs_wo_monthly_counts] * * Shows a bar chart of CLOSED work orders by Completed Date month * with a single blue color family in progressively darker shades. */ add_shortcode(‘frs_wo_monthly_counts’,…Continue reading
/** * Plugin Name: Proceso de Orla (CPT + Estado + Notificaciones) * Description: CPT “Proceso de Orla” con fase por grado (1–6), timeline por rol con iconos, notificaciones por lotes, reenvío, quick edit, seeder, fase 1 por defecto y…Continue reading
add_action( ‘pre_get_posts’, function ( WP_Query $query ) { // Only affect frontend main product queries (shop, category, etc.) if ( is_admin() || ! $query->is_main_query() || ‘product’ !== $query->get( ‘post_type’ ) ) { return; } $user_id = get_current_user_id(); // Admins /…Continue reading
function defer_some_scripts($tag, $handle, $src) { $is_hcaptcha_script = str_starts_with( $handle, ‘hcaptcha’ ); $is_callrail_swap_script = str_starts_with( $handle, ‘swapjs’); $should_defer = $is_hcaptcha_script || $is_callrail_swap_script; if ( $should_defer ) { $tag = str_replace(‘>‘, ‘ defer>‘, $tag); } return $tag; } add_filter(‘script_loader_tag’, ‘defer_some_scripts’, 10, 3);Continue reading
function modify_woocommerce_order_response( $response, $order, $request ) { if ( is_a( $order, ‘WC_Order’ ) ) { $data = $response->get_data(); $data[‘wc_id’] = $data[‘id’]; $data[‘id’] = intval($order->get_order_number()); $response->set_data( $data ); } return $response; } add_filter( ‘woocommerce_rest_prepare_shop_order_object’, ‘modify_woocommerce_order_response’, 10, 3 );Continue reading
/** * Plugin Name: WC REST: Update Order by Shopify Order Number * Description: Aggiunge un endpoint REST per aggiornare un ordine partendo dal meta shopify_order_number. * Author: You * Version: 1.0.0 */ if ( ! defined( ‘ABSPATH’ ) )…Continue reading
add_filter( ‘woocommerce_rest_prepare_shop_order_object’, ‘modify_order_response_add_shopify_coupons’, 10, 3 ); function modify_order_response_add_shopify_coupons( $response, $order, $request ) { // Fetch the meta data from the order $shopify_coupons = $order->get_meta( ‘shopify_coupons’ ); // Add the meta data to the coupon_lines in the response if ( !…Continue reading
/** * Compliance Calendar – Cron Jobs (Overdue Detection) * Checks for overdue compliance items and sends notifications via GHL webhook * * @package BHA_Portal * @subpackage Compliance_Calendar * @version 6.1 * * WPCODE SETTINGS: * – Location: Run Everywhere…Continue reading
add_action(‘admin_init’, function () { global $wp_post_types; if (isset($wp_post_types[‘frm_display’])) { $post_type = $wp_post_types[‘frm_display’]; $post_type->public = true; $post_type->show_ui = true; $post_type->show_in_nav_menus = true; } });Continue reading
function acf_field_shortcode($atts) { $atts = shortcode_atts(array( ‘field’ => ”, ‘post_id’ => false, ), $atts, ‘acf’); if (function_exists(‘get_field’)) { $field_value = get_field($atts[‘field’], $atts[‘post_id’]); // If the field is an array (like a select, relationship, or taxonomy field) if (is_array($field_value)) { $output…Continue reading