WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Получай пассивный доход от сайта с помощью браузерных PUSH уведомлений
функция не описана

Automattic\WooCommerce\Admin

Loader::register_scripts() public WC 1.0

Registers all the neccessary scripts and styles to show the admin experience.

{} Это метод класса: Loader{}

Хуков нет.

Возвращает

null. Ничего.

Использование

$result = Loader::register_scripts();

Код Loader::register_scripts() WC 5.2.2

<?php
public static function register_scripts() {
	if ( ! function_exists( 'wp_set_script_translations' ) ) {
		return;
	}

	$js_file_version  = self::get_file_version( 'js' );
	$css_file_version = self::get_file_version( 'css' );

	wp_register_script(
		'wc-csv',
		self::get_url( 'csv-export/index', 'js' ),
		array( 'moment' ),
		$js_file_version,
		true
	);

	wp_register_script(
		'wc-currency',
		self::get_url( 'currency/index', 'js' ),
		array( 'wc-number' ),
		$js_file_version,
		true
	);

	wp_set_script_translations( 'wc-currency', 'woocommerce' );

	wp_register_script(
		'wc-customer-effort-score',
		self::get_url( 'customer-effort-score/index', 'js' ),
		array(
			'wp-components',
			'wp-compose',
			'wp-data',
			'wp-element',
			'wp-i18n',
			'wp-notices',
		),
		$js_file_version,
		true
	);

	wp_register_script(
		'wc-navigation',
		self::get_url( 'navigation/index', 'js' ),
		array( 'wp-url', 'wp-hooks', 'wp-element', 'wp-data', 'moment', 'wp-components' ),
		$js_file_version,
		true
	);

		// NOTE: This should be removed when Gutenberg is updated and
		// the notices package is removed from WooCommerce Admin.
		wp_register_script(
			'wc-notices',
			self::get_url( 'notices/index', 'js' ),
			array(),
			$js_file_version,
			true
		);

	wp_register_script(
		'wc-number',
		self::get_url( 'number/index', 'js' ),
		array(),
		$js_file_version,
		true
	);

	wp_register_script(
		'wc-tracks',
		self::get_url( 'tracks/index', 'js' ),
		array(),
		$js_file_version,
		true
	);

	wp_register_script(
		'wc-date',
		self::get_url( 'date/index', 'js' ),
		array( 'moment', 'wp-date', 'wp-i18n' ),
		$js_file_version,
		true
	);

	wp_register_script(
		'wc-store-data',
		self::get_url( 'data/index', 'js' ),
		array( 'wp-data' ),
		$js_file_version,
		true
	);

	wp_set_script_translations( 'wc-date', 'woocommerce' );

	wp_register_script(
		'wc-components',
		self::get_url( 'components/index', 'js' ),
		array(
			'moment',
			'wp-api-fetch',
			'wp-data',
			'wp-data-controls',
			'wp-element',
			'wp-hooks',
			'wp-html-entities',
			'wp-i18n',
			'wp-keycodes',
			'wc-csv',
			'wc-currency',
			'wc-customer-effort-score',
			'wc-date',
			'wc-navigation',
			// NOTE: This should be removed when Gutenberg is updated and
			// the notices package is removed from WooCommerce Admin.
			'wc-notices',
			'wc-number',
			'wc-store-data',
			'wp-components',
		),
		$js_file_version,
		true
	);

	wp_set_script_translations( 'wc-components', 'woocommerce' );

	wp_register_style(
		'wc-components',
		self::get_url( 'components/style', 'css' ),
		array(),
		$css_file_version
	);
	wp_style_add_data( 'wc-components', 'rtl', 'replace' );

	wp_register_style(
		'wc-components-ie',
		self::get_url( 'components/ie', 'css' ),
		array(),
		$css_file_version
	);
	wp_style_add_data( 'wc-components-ie', 'rtl', 'replace' );

	wp_register_style(
		'wc-customer-effort-score',
		self::get_url( 'customer-effort-score/style', 'css' ),
		array(),
		$css_file_version
	);
	wp_style_add_data( 'wc-customer-effort-score', 'rtl', 'replace' );

	wp_register_script(
		WC_ADMIN_APP,
		self::get_url( 'app/index', 'js' ),
		array(
			'wp-core-data',
			'wp-components',
			'wc-components',
			'wp-date',
			'wp-plugins',
			'wc-tracks',
			'wc-navigation',
		),
		$js_file_version,
		true
	);
	wp_localize_script(
		WC_ADMIN_APP,
		'wcAdminAssets',
		array(
			'path'    => plugins_url( self::get_path( 'js' ), WC_ADMIN_PLUGIN_FILE ),
			'version' => $js_file_version,
		)
	);

	wp_set_script_translations( WC_ADMIN_APP, 'woocommerce' );

	// The "app" RTL files are in a different format than the components.
	$rtl = is_rtl() ? '.rtl' : '';

	wp_register_style(
		WC_ADMIN_APP,
		self::get_url( "app/style{$rtl}", 'css' ),
		array( 'wc-components', 'wc-customer-effort-score', 'wp-components' ),
		$css_file_version
	);

	wp_register_style(
		'wc-admin-ie',
		self::get_url( "ie/style{$rtl}", 'css' ),
		array( WC_ADMIN_APP ),
		$css_file_version
	);
}