WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Самая быстрая Тема-конструктор для WordPress
функция не описана

WPSEO_Admin_Asset_Manager::scripts_to_be_registered() protected Yoast 1.0

Returns the scripts that need to be registered.

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

Хуков нет.

Возвращает

Массив. The scripts that need to be registered.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->scripts_to_be_registered();

Код WPSEO_Admin_Asset_Manager::scripts_to_be_registered() Yoast 15.1.1

<?php
protected function scripts_to_be_registered() {
	$select2_language = 'en';
	$user_locale      = WPSEO_Language_Utils::get_user_locale();
	$language         = WPSEO_Language_Utils::get_language( $user_locale );

	if ( file_exists( WPSEO_PATH . "js/dist/select2/i18n/{$user_locale}.js" ) ) {
		$select2_language = $user_locale; // Chinese and some others use full locale.
	}
	elseif ( file_exists( WPSEO_PATH . "js/dist/select2/i18n/{$language}.js" ) ) {
		$select2_language = $language;
	}

	$flat_version = $this->flatten_version( WPSEO_VERSION );

	return [
		[
			'name'      => 'commons',
			// Load webpack-commons for bundle support.
			'src'       => 'commons-' . $flat_version,
			'in_footer' => false,
			'deps'      => [
				'lodash',
				'wp-polyfill',
			],
		],
		[
			'name' => 'search-appearance',
			'src'  => 'search-appearance-' . $flat_version,
			'deps' => [
				'wp-api',
				self::PREFIX . 'components',
				self::PREFIX . 'commons',
			],
		],
		[
			'name' => 'yoast-modal',
			'src'  => 'modal-' . $flat_version,
			'deps' => [
				'jquery',
				'wp-element',
				'wp-i18n',
				self::PREFIX . 'components',
				self::PREFIX . 'commons',
			],
		],
		[
			'name' => 'settings',
			'src'  => 'settings-' . $flat_version,
			'deps' => [
				'lodash',
				'jquery',
				'jquery-ui-core',
				'jquery-ui-progressbar',
				'wp-api',
				self::PREFIX . 'commons',
				self::PREFIX . 'components',
				self::PREFIX . 'select2',
				self::PREFIX . 'select2-translations',
			],
		],
		[
			'name' => 'network-admin-script',
			'src'  => 'network-admin-' . $flat_version,
			'deps' => [
				'jquery',
				'wp-element',
				'wp-i18n',
				self::PREFIX . 'commons',
			],
		],
		[
			'name' => 'bulk-editor',
			'src'  => 'bulk-editor-' . $flat_version,
			'deps' => [
				'jquery',
				self::PREFIX . 'commons',
			],
		],
		[
			'name'      => 'admin-global-script',
			'src'       => 'admin-global-' . $flat_version,
			'deps'      => [
				'jquery',
				self::PREFIX . 'commons',
			],
			'in_footer' => false,
		],
		[
			'name'      => 'block-editor',
			'src'       => 'block-editor-' . $flat_version,
			'deps'      => [
				'wp-annotations',
				'wp-blocks',
				'wp-components',
				'wp-compose',
				'wp-edit-post',
				'wp-element',
				self::PREFIX . 'components',
			],
			'in_footer' => false,
		],
		[
			'name'      => 'classic-editor',
			'src'       => 'classic-editor-' . $flat_version,
			'deps'      => [
				'wp-components',
				'wp-compose',
				'wp-element',
				self::PREFIX . 'components',
				'wp-api-fetch',
			],
			'in_footer' => false,
		],
		[
			'name'      => 'post-edit',
			'src'       => 'post-edit-' . $flat_version,
			'deps'      => [
				'jquery',
				'wp-api',
				'wp-api-fetch',
				'wp-data',
				'wp-i18n',
				'wp-is-shallow-equal',
				'wp-sanitize',
				'wp-url',
				'wp-util',
				self::PREFIX . 'analysis',
				self::PREFIX . 'block-editor',
				self::PREFIX . 'commons',
				self::PREFIX . 'redux',
				self::PREFIX . 'select2',
				self::PREFIX . 'select2-translations',
			],
			'in_footer' => false,
		],
		[
			'name'      => 'post-edit-classic',
			'src'       => 'post-edit-' . $flat_version,
			'deps'      => [
				'jquery',
				'wp-api',
				'wp-api-fetch',
				'wp-data',
				'wp-i18n',
				'wp-is-shallow-equal',
				'wp-sanitize',
				'wp-url',
				'wp-util',
				self::PREFIX . 'analysis',
				self::PREFIX . 'classic-editor',
				self::PREFIX . 'commons',
				self::PREFIX . 'redux',
				self::PREFIX . 'select2',
				self::PREFIX . 'select2-translations',
			],
			'in_footer' => false,
		],
		[
			'name' => 'term-edit',
			'src'  => 'term-edit-' . $flat_version,
			'deps' => [
				'jquery',
				'wp-sanitize',
				'wp-element',
				'wp-i18n',
				'wp-data',
				'wp-api-fetch',
				'wp-components',
				'wp-compose',
				'wp-is-shallow-equal',
				self::PREFIX . 'redux',
				self::PREFIX . 'analysis',
				self::PREFIX . 'components',
				self::PREFIX . 'classic-editor',
				self::PREFIX . 'commons',
				self::PREFIX . 'select2',
				self::PREFIX . 'select2-translations',
			],
		],
		[
			'name'    => 'select2',
			'src'     => 'select2/select2.full',
			'suffix'  => '.min',
			'deps'    => [
				'jquery',
			],
			'version' => '4.0.3',
		],
		[
			'name'    => 'select2-translations',
			'src'     => 'select2/i18n/' . $select2_language,
			'deps'    => [
				'jquery',
				self::PREFIX . 'select2',
			],
			'version' => '4.0.3',
		],
		[
			'name' => 'configuration-wizard',
			'src'  => 'configuration-wizard-' . $flat_version,
			'deps' => [
				'jquery',
				'wp-element',
				'wp-i18n',
				'wp-api',
				self::PREFIX . 'components',
				self::PREFIX . 'commons',
			],
		],
		[
			'name' => 'reindex-links',
			'src'  => 'reindex-links-' . $flat_version,
			'deps' => [
				'jquery',
				'jquery-ui-core',
				'jquery-ui-progressbar',
				self::PREFIX . 'commons',
			],
		],
		[
			'name' => 'indexation',
			'src'  => 'indexation-' . $flat_version,
			'deps' => [
				'jquery',
				'jquery-ui-core',
				'jquery-ui-progressbar',
				self::PREFIX . 'admin-global-script',
				self::PREFIX . 'commons',
				self::PREFIX . 'components',
			],
		],
		[
			'name' => 'edit-page-script',
			'src'  => 'edit-page-' . $flat_version,
			'deps' => [
				'jquery',
				self::PREFIX . 'commons',
			],
		],
		[
			'name'      => 'quick-edit-handler',
			'src'       => 'quick-edit-handler-' . $flat_version,
			'deps'      => [
				'jquery',
				self::PREFIX . 'commons',
			],
			'in_footer' => true,
		],
		[
			'name' => 'api',
			'src'  => 'api-client-' . $flat_version,
			'deps' => [
				'wp-api',
				'jquery',
				self::PREFIX . 'commons',
			],
		],
		[
			'name' => 'dashboard-widget',
			'src'  => 'dashboard-widget-' . $flat_version,
			'deps' => [
				self::PREFIX . 'api',
				'jquery',
				'wp-element',
				'wp-i18n',
				self::PREFIX . 'components',
				self::PREFIX . 'commons',
			],
		],
		[
			'name' => 'filter-explanation',
			'src'  => 'filter-explanation-' . $flat_version,
			'deps' => [
				'jquery',
				self::PREFIX . 'commons',
			],
		],
		[
			'name' => 'analysis',
			'src'  => 'analysis-' . $flat_version,
			'deps' => [
				'lodash',
				self::PREFIX . 'commons',
			],
		],
		[
			'name' => 'components',
			'src'  => 'components-' . $flat_version,
			'deps' => [
				self::PREFIX . 'jed',
				self::PREFIX . 'redux',
				self::PREFIX . 'analysis',
				self::PREFIX . 'styled-components',
				self::PREFIX . 'commons',
				self::PREFIX . 'draft-js',
				'wp-a11y',
				'wp-dom-ready',
			],
		],
		[
			'name' => 'structured-data-blocks',
			'src'  => 'structured-data-blocks-' . $flat_version,
			'deps' => [
				'wp-blocks',
				'wp-i18n',
				'wp-element',
				'wp-is-shallow-equal',
				self::PREFIX . 'styled-components',
				self::PREFIX . 'commons',
			],
		],
		[
			'name' => 'styled-components',
			'src'  => 'styled-components-' . $flat_version,
			'deps' => [
				'wp-element',
			],
		],
		[
			'name' => 'redux',
			'src'  => 'redux-' . $flat_version,
		],
		[
			'name' => 'jed',
			'src'  => 'jed-' . $flat_version,
		],
		[
			'name'      => 'help-scout-beacon',
			'src'       => 'help-scout-beacon-' . $flat_version,
			'in_footer' => false,
			'deps'      => [
				self::PREFIX . 'styled-components',
				'wp-element',
				'wp-i18n',
			],
		],
		[
			'name' => 'draft-js',
			'src'  => 'draft-js-' . $flat_version,
		],
	];
}