Tribe__Events__Aggregator__Page::aggregator_should_load_scripts()

Basically an edited version of is_screen(), below, that allows for loading on all non-post edit admin pages.


Return #

(boolean)


Top ↑

Source #

File: src/Tribe/Aggregator/Page.php

	public function aggregator_should_load_scripts() {
		global $current_screen;

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

		if ( ! ( $current_screen instanceof WP_Screen ) ) {
			return false;
		}

		// Don't load on post edit screens - can conflict with other datepickers.
		if ( $current_screen->base === 'post' || $current_screen->base === 'post-new') {
			return false;
		}

		/**
		 * Allows for selective disabling of script loading.
		 *
		 * @since 5.16.2.1
		 *
		 * @param boolean $should_load Whether the scripts should load. Default true if we got here
		 */
		return apply_filters( 'aggregator_should_load_scripts', true );
	}

Top ↑

Changelog #

Changelog
Version Description
5.16.2.1 Introduced.