Automattic\WooCommerce\Admin
Loader::load_scripts() public WC 1.0
Loads the required scripts on the correct pages.
{} Это метод класса: Loader{}
Хуков нет.
Возвращает
null
. Null. Ничего.
Использование
$result = Loader::load_scripts();
Код Loader::load_scripts() Loader::load scripts WC 5.2.0
public static function load_scripts() {
if ( ! self::is_admin_or_embed_page() ) {
return;
}
// Grab translation strings from Webpack-generated chunks.
add_filter( 'load_script_translation_file', array( __CLASS__, 'load_script_translation_file' ), 10, 3 );
wp_enqueue_script( WC_ADMIN_APP );
wp_enqueue_style( WC_ADMIN_APP );
wp_enqueue_style( 'wc-material-icons' );
// Use server-side detection to prevent unneccessary stylesheet loading in other browsers.
$user_agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : ''; // phpcs:ignore sanitization ok.
preg_match( '/MSIE (.*?);/', $user_agent, $matches );
if ( count( $matches ) < 2 ) {
preg_match( '/Trident\/\d{1,2}.\d{1,2}; rv:([0-9]*)/', $user_agent, $matches );
}
if ( count( $matches ) > 1 ) {
wp_enqueue_style( 'wc-components-ie' );
wp_enqueue_style( 'wc-admin-ie' );
}
// Preload our assets.
self::output_header_preload_tags();
}