Page::get_implicitly_requested_post_stati()

Gets all of the relevant post stati for the current request.


Return

(array)


Top ↑

Source

File: src/Tribe/Admin/Manager/Page.php

	public function get_implicitly_requested_post_stati() {
		$requested_status = $this->get_requested_post_status();

		$post_stati = get_post_stati( [], 'objects' );
		unset( $post_stati['auto-draft'] );
		unset( $post_stati['inherit'] );

		if (
			! $requested_status
			|| (
				$requested_status
				&& 'trash' !== $requested_status
				&& 'tribe-ignored' !== $requested_status
			)
		) {
			unset( $post_stati['trash'] );
			unset( $post_stati['tribe-ignored'] );
		}

		if ( $requested_status && 'trash' === $requested_status ) {
			$post_stati = [
				'trash'         => $post_stati['trash'],
				'tribe-ignored' => $post_stati['tribe-ignored'],
			];
		} elseif ( $requested_status && 'tribe-ignored' === $requested_status ) {
			$post_stati = [
				'tribe-ignored' => $post_stati[ 'tribe-ignored' ],
			];
		} elseif ( $requested_status && isset( $post_stati[ $requested_status ] ) ) {
			$post_stati = [ $requested_status => $post_stati[ $requested_status ] ];
		}

		return array_keys( $post_stati );
	}

Top ↑

Changelog

Changelog
Version Description
5.9.0 Introduced.