register_bsf_core_admin_styles( string $hook )

Register BSF Core Admin Styles


Description


Parameters

$hook

(string) (Required) Hook.


Source

File: admin/bsf-core/index.php

	function register_bsf_core_admin_styles( $hook ) {
		// bsf core style.
		$hook_array = array(
			'toplevel_page_bsf-registration',
			'update-core.php',
			'dashboard_page_bsf-registration',
			'index_page_bsf-registration',
			'admin_page_bsf-extensions',
			'settings_page_bsf-registration',
			'admin_page_bsf-registration',
			'plugins.php',
			'imedica_page_product-license',
		);
		$hook_array = apply_filters( 'bsf_core_style_screens', $hook_array );

		if ( in_array( $hook, $hook_array, true ) || strpos( $hook, 'bsf-extensions' ) !== false ) {

			$envato_activation_nonce = wp_create_nonce( 'envato_activation_nonce' );

			wp_register_style( 'bsf-core-admin', bsf_core_url( '/assets/css/style.css' ), array(), BSF_UPDATER_VERSION );
			wp_enqueue_style( 'bsf-core-admin' );

			wp_register_style( 'brainstorm-switch', bsf_core_url( '/assets/css/switch.css' ), array(), BSF_UPDATER_VERSION );
			wp_enqueue_style( 'brainstorm-switch' );

			wp_register_script( 'brainstorm-switch', bsf_core_url( '/assets/js/switch.js' ), array( 'jquery' ), BSF_UPDATER_VERSION, true );
			wp_enqueue_script( 'brainstorm-switch' );

			wp_register_script( 'bsf-core', bsf_core_url( '/assets/js/bsf-core.js' ), array( 'jquery' ), BSF_UPDATER_VERSION, true );

			wp_localize_script( 'bsf-core', 'bsf_core', array( 'envato_activation_nonce' => $envato_activation_nonce ) );

			wp_enqueue_script( 'bsf-core' );
		}

		// frosty script.
		$hook_frosty_array = array();
		$hook_frosty_array = apply_filters( 'bsf_core_frosty_screens', $hook_frosty_array );
		if ( in_array( $hook, $hook_frosty_array, true ) ) {
			wp_register_script( 'bsf-core-frosty', bsf_core_url( '/assets/js/frosty.js' ), array(), BSF_UPDATER_VERSION, false );
			wp_enqueue_script( 'bsf-core-frosty' );

			wp_register_style( 'bsf-core-frosty-style', bsf_core_url( '/assets/css/frosty.css' ), array(), BSF_UPDATER_VERSION );
			wp_enqueue_style( 'bsf-core-frosty-style' );
		}
	}


User Contributed Notes

You must log in before being able to contribute a note or feedback.