Automattic\WooCommerce\Blocks\Domain\Services
DraftOrders::ensure_draft_status_registered()
Since it's possible for third party code to clobber the $wp_post_statuses global, we need to do a final check here to make sure the draft post status is registered with the global so that it is not removed by WP_Query status validation checks.
Method of the class: DraftOrders{}
No Hooks.
Return
null
. Nothing (null).
Usage
// private - for code of main (parent) class only $result = $this->ensure_draft_status_registered();
DraftOrders::ensure_draft_status_registered() DraftOrders::ensure draft status registered code WC 8.7.0
private function ensure_draft_status_registered() { $is_registered = get_post_stati( [ 'name' => self::DB_STATUS ] ); if ( empty( $is_registered ) ) { register_post_status( self::DB_STATUS, $this->get_post_status_properties() ); } }