function pm_hide_customer_profile_notes_on_add_user( $match, $rule, $screen, $field_group ) { if ( ! $match || ‘user_form’ !== $rule[‘param’] || empty( $screen[‘user_form’] ) || ‘add’ !== $screen[‘user_form’] || ! function_exists( ‘acf_get_field’ ) ) { return $match; } static $customer_profile_notes_parent = null; if (…Continue reading
function rd_refund_button_has_transaction_id( $order ) { return $order instanceof WC_Order && ” !== trim( (string) $order->get_transaction_id() ); } function rd_refund_button_should_be_hidden( $order ) { return $order instanceof WC_Order && ! rd_refund_button_has_transaction_id( $order ) && $order->has_status( array( ‘new’, ‘auto-draft’, ‘draft’, ‘checkout-draft’, ‘pending’, ‘failed’,…Continue reading
function rd_hide_yoohw_split_order_button() { if ( ! class_exists( ‘WooCommerce_Order_Splitter_Edit_Order_Split_Button’ ) ) { return; } $screen = get_current_screen(); if ( ! $screen ) { return; } $is_legacy_order_edit = ‘shop_order’ === $screen->id; $is_hpos_order_edit = ( function_exists( ‘wc_get_page_screen_id’ ) && wc_get_page_screen_id( ‘shop-order’ ) ===…Continue reading
function rd_yoohw_clone_order_is_available( $order ) { if ( ! function_exists( ‘wc_get_order’ ) || ! class_exists( ‘WC_Order’ ) || ! $order instanceof WC_Order || ! has_action( ‘woocommerce_order_action_yoos_duplicate_order’ ) || ! current_user_can( ‘administrator’ ) || ! current_user_can( ‘edit_shop_order’, $order->get_id() ) ) { return…Continue reading
function rd_get_yoohw_duplicate_note_reference_order_id( $note_content, $note_template ) { $pattern = ‘/^’ . str_replace( ‘%s’, ‘([0-9]+)’, preg_quote( $note_template, ‘/’ ) ) . ‘$/’; if ( ! preg_match( $pattern, $note_content, $matches ) ) { return 0; } return absint( $matches[1] ); } function rd_show_order_numbers_in_yoohw_duplicate_notes(…Continue reading
function rd_mark_yoohw_order_duplicate_on_redirect( $location ) { if ( ! function_exists( ‘wc_get_order’ ) || ! class_exists( ‘WC_Order’ ) || ! has_action( ‘woocommerce_order_action_yoos_duplicate_order’ ) ) { return $location; } $redirect_parts = wp_parse_url( $location ); if ( empty( $redirect_parts[‘query’] ) ) { return $location;…Continue reading
function rd_reset_payment_method_on_yoohw_order_duplicate_redirect( $location ) { if ( ! function_exists( ‘wc_get_order’ ) || ! class_exists( ‘WC_Order’ ) || ! has_action( ‘woocommerce_order_action_yoos_duplicate_order’ ) ) { return $location; } $redirect_parts = wp_parse_url( $location ); if ( empty( $redirect_parts[‘query’] ) ) { return $location;…Continue reading
add_filter( ‘wc_order_is_editable’, function ( $is_editable, $order ) { if ( ! $order instanceof WC_Order ) { return $is_editable; } if ( ! current_user_can( ‘edit_shop_order’, $order->get_id() ) ) { return $is_editable; } return $is_editable || in_array( $order->get_status(), array( ‘checkout-draft’, ‘processing’ ),…Continue reading
add_filter( ‘wt_iew_use_wc_order_stats_for_export_order_count’, ‘__return_false’ );Continue reading
add_action( ‘admin_init’, ‘autoriser_admin_sur_les_traductions’ ); function autoriser_admin_sur_les_traductions() { // Sécurité : on vérifie que la fonction existe et que l’utilisateur est admin if ( ! function_exists( ‘get_role’ ) || ! current_user_can( ‘administrator’ ) ) { return; } $role = get_role( ‘administrator’…Continue reading