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.


Top ↑

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.


Top ↑

Return Return

(string)


Top ↑

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;

	}


Top ↑

Changelog Changelog

Changelog
Version Description
7.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.