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->id ); $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 ); // 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 { 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 ); } }