Tribe__Tickets__Assets::should_enqueue_admin_settings_assets()

Check if we should add the Admin Settings Assets onto an admin page.


Return

(bool)


Top ↑

Source

File: src/Tribe/Assets.php

	public function should_enqueue_admin_settings_assets() {

		$admin_helpers = Tribe__Admin__Helpers::instance();

		// The list of admin tabs that the plugin hooks into.
		$admin_tabs = [
			'event-tickets',
			'event-tickets-commerce',
			'payments',
		];

		// Load specifically on Ticket Settings page only.
		$should_enqueue = $admin_helpers->is_screen() && in_array( tribe_get_request_var( 'tab' ), $admin_tabs, true );

		/**
		 * Allow filtering of whether the base Admin Settings Assets should be loaded.
		 *
		 * @since 5.1.2
		 *
		 * @param bool $should_enqueue Should enqueue the settings asset or not.
		 */
		return apply_filters( 'event_tickets_should_enqueue_admin_settings_assets', $should_enqueue );
	}

Top ↑

Changelog

Changelog
Version Description
5.1.2 Introduced.