ID ); } $order_type_object = get_post_type_object( $post->post_type ); ?> payment_gateways(); WC()->shipping(); // Load mailer. $mailer = WC()->mailer(); $email_to_send = str_replace( 'send_email_', '', $action ); $mails = $mailer->get_emails(); if ( ! empty( $mails ) ) { foreach ( $mails as $mail ) { if ( $mail->id == $email_to_send ) { $mail->trigger( $order->get_id() ); /* translators: %s: email title */ $order->add_order_note( sprintf( __( '%s email notification manually sent.', 'woocommerce' ), $mail->title ), false, true ); } } } do_action( 'woocommerce_after_resend_order_email', $order, $email_to_send ); // Restore user locale. if ( function_exists( 'restore_current_locale' ) ) { restore_current_locale(); } // Change the post saved message. add_filter( 'redirect_post_location', array( __CLASS__, 'set_email_sent_message' ) ); } elseif ( 'regenerate_download_permissions' === $action ) { $data_store = WC_Data_Store::load( 'customer-download' ); $data_store->delete_by_order_id( $post_id ); wc_downloadable_product_permissions( $post_id, true ); } else { if ( ! did_action( 'woocommerce_order_action_' . sanitize_title( $action ) ) ) { do_action( 'woocommerce_order_action_' . sanitize_title( $action ), $order ); } } } } /** * Set the correct message ID. * * @param string $location * * @since 2.3.0 * * @static * * @return string */ public static function set_email_sent_message( $location ) { return add_query_arg( 'message', 11, $location ); } }