Admin_Menu::reporting_assets( $hook )


Parameters Parameters

$hook

(Required)


Source Source

File: src/core/admin/class-admin-menu.php

	public function reporting_assets( $hook ) {
		$is_a_log = ( strpos( $hook, 'uncanny-automator-recipe-activity' ) !== false )
					|| ( strpos( $hook, 'uncanny-automator-recipe-activity-details' ) !== false )
					|| ( strpos( $hook, 'uncanny-automator-debug-log' ) !== false )
					|| ( strpos( $hook, 'uncanny-automator-recipe-log' ) !== false )
					|| ( strpos( $hook, 'uncanny-automator-trigger-log' ) !== false )
					|| ( strpos( $hook, 'uncanny-automator-action-log' ) !== false );

		// Load tools.css.
		$load_in_pages = array(
			'uo-recipe_page_uncanny-automator-database-tools',
			'uo-recipe_page_uncanny-automator-tools',
			'uo-recipe_page_uncanny-automator-debug-log',
		);

		if ( in_array( $hook, $load_in_pages, true ) ) {
			wp_enqueue_style( 'uap-admin-tools', Utilities::automator_get_css( 'admin/tools.css' ), array(), Utilities::automator_get_version() );
		}

		if ( $is_a_log ) {
			Utilities::automator_enqueue_global_assets();
			// Automator assets
			wp_enqueue_script( 'jquery-ui-tabs' );
			wp_enqueue_style( 'uap-logs-free', Utilities::automator_get_css( 'admin/logs.css' ), array(), Utilities::automator_get_version() );

		}

		if ( 'uo-recipe_page_uncanny-automator-settings' === (string) $hook ) {
			Utilities::automator_enqueue_global_assets();
			// Automator assets.
			wp_enqueue_style( 'uap-admin-settings', Utilities::automator_get_css( 'admin/performance.css' ), array(), Utilities::automator_get_version() );
		}
	}