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->id ); } } } do_action( 'woocommerce_after_resend_order_email', $order, $email_to_send ); // Change the post saved message add_filter( 'redirect_post_location', array( __CLASS__, 'set_email_sent_message' ) ); } elseif ( $action == 'regenerate_download_permissions' ) { delete_post_meta( $post_id, '_download_permissions_granted' ); wc_downloadable_product_permissions( $post_id ); } else { do_action( 'woocommerce_order_action_' . sanitize_title( $action ), $order ); } } } /** * Set the correct message ID * * @param $location * * @since 2.3.0 * * @static * * @return string */ public static function set_email_sent_message( $location ) { return add_query_arg( 'message', 11, $location ); } }