Telemetry::is_tec_admin_page()

Determines if we are on a TEC admin page except the post edit page.


Return

(boolean)


Top ↑

Source

File: src/Events/Telemetry/Telemetry.php

	public static function is_tec_admin_page(): bool {
		$current_screen = get_current_screen();
		$helper = \Tribe__Admin__Helpers::instance();

		// Are we on a tec post-type admin screen?
		if ( ! $helper->is_post_type_screen( TEC::POSTTYPE ) ) {
			return false;
		}

		// Are we on a post edit screen?
		if ( $current_screen instanceof \WP_Screen && tribe_get_request_var( 'action' ) === 'edit' ) {
			return false;
		}

		// Are we on a new post screen?
		if ( $current_screen instanceof \WP_Screen && $current_screen->action === 'add' ) {
			return false;
		}

		return true;
	}

Top ↑

Changelog

Changelog
Version Description
6.1.0 Introduced.