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
function rd_greenbook_house_count_shortcode() { $counts = wp_count_posts( ‘wpsl_stores’ ); return isset( $counts->publish ) ? esc_html( number_format_i18n( (int) $counts->publish ) ) : ‘0’; } add_shortcode( ‘rd_greenbook_house_count’, ‘rd_greenbook_house_count_shortcode’ );Continue reading
add_action( ‘admin_notices’, ‘rd_report_action_scheduler_source’ ); function rd_report_action_scheduler_source() { if ( ! current_user_can( ‘manage_options’ ) ) { return; } $versions_class = ‘ActionScheduler_Versions’; $system_info_class = ‘ActionScheduler_SystemInformation’; $action_scheduler_class = ‘ActionScheduler’; echo ‘ ‘; if ( ! class_exists( $versions_class ) && ! class_exists( $action_scheduler_class )…Continue reading
// Czyszczenie imienia i nazwiska w bilingu, jeśli wybrano firmę lub podano nazwę firmy add_action( ‘woocommerce_checkout_create_order’, ‘custom_clear_billing_names_for_company_checkout’, 10, 2 ); function custom_clear_billing_names_for_company_checkout( $order, $data ) { // 1. Sprawdzamy przesłane dane z formularza FCF (radio/select) $kategoria_post = isset( $_POST[‘kategoria_zakupu’] )…Continue reading
function custom_login_logo() { echo ‘ ‘; } add_action(‘login_head’, ‘custom_login_logo’); function login_url(){ return “https://kashianupamhotel.com/”; // Your URL Here } add_filter(‘login_headerurl’, ‘login_url’);Continue reading