= $sdate) && ($tdate <= $edate)){ return true; } else { return false; } } // function to dinamically add the start and end date to the out of office message function out_of_office_for_woo_include_dates_in_message($start_date, $end_date, $message){ $message_compiled = str_replace("[StartDate]", wp_date(get_option('date_format'), strtotime($start_date)), $message); $message_compiled = str_replace("[EndDate]", wp_date(get_option('date_format'), strtotime($end_date)), $message_compiled); return $message_compiled; } // function to add the out of office message to the order confirmation email //add_action( 'woocommerce_email_before_order_table', 'out_of_office_for_woo_show_in_order_confirmation_email', 20 ); add_action( 'woocommerce_email_header', 'out_of_office_for_woo_show_in_order_confirmation_email', 20 ); function out_of_office_for_woo_show_in_order_confirmation_email( $order ) { $ooo_woo_show_in_order_confirmation_email = esc_attr(get_option( 'ooo_woo_show_in_order_confirmation_email', '' )); if ((out_of_office_for_woo_is_active()) && ($ooo_woo_show_in_order_confirmation_email == "Yes")) { $ooo_woo_message = esc_attr(get_option( 'ooo_woo_message', '' )); $ooo_woo_title = esc_attr(get_option( 'ooo_woo_title', '' )); $ooo_woo_start_date = esc_attr(get_option( 'ooo_woo_start_date', '' )); $ooo_woo_end_date = esc_attr(get_option( 'ooo_woo_end_date', '' )); $ooo_woo_message_compiled = out_of_office_for_woo_include_dates_in_message($ooo_woo_start_date, $ooo_woo_end_date, $ooo_woo_message); ?>









: