LLMS_Controller_Orders::set_untrash_status( string $new_status, int $post_id, string $previous_status )
Sets an order’s post status to llms-pending when untrashing an order.
Description Description
This is a filter hook callback for the WP core filter wp_untrash_post_status.
Parameters Parameters
- $new_status
-
(string) (Required) The new status of the post after untrashing.
- $post_id
-
(int) (Required) The WP_Post ID of the order.
- $previous_status
-
(string) (Required) The status of the post at the point where it was trashed.
Return Return
(string)
Source Source
File: includes/controllers/class.llms.controller.orders.php
public function set_untrash_status( $new_status, $post_id, $previous_status ) {
if ( 'llms_order' === get_post_type( $post_id ) ) {
/**
* Filters the status that an order post gets assigned when it is restored from the trash.
*
* This is a filter nearly identical to `wp_untrash_post_status` applied specifically to `llms_order` posts.
*
* @since 7.0.0
*
* @link https://developer.wordpress.org/reference/hooks/wp_untrash_post_status/
*
* @param string $new_status The new status of the post being restored.
* @param int $post_id The ID of the post being restored.
* @param string $previous_status The status of the post at the point where it was trashed.
*/
$new_status = apply_filters( 'llms_untrash_order_status', 'llms-pending', $post_id, $previous_status );
}
return $new_status;
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 7.0.0 | Introduced. |