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

WPSEO_Taxonomy::admin_enqueue_scripts() public Yoast 1.5.0

Queue assets for taxonomy screens.

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

Хуков нет.

Возвращает

Null. Ничего.

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

$WPSEO_Taxonomy = new WPSEO_Taxonomy();
$WPSEO_Taxonomy->admin_enqueue_scripts();

Список изменений

С версии 1.5.0 Введена.

Код WPSEO_Taxonomy::admin_enqueue_scripts() Yoast 15.1.1

<?php
public function admin_enqueue_scripts() {

	$pagenow = $GLOBALS['pagenow'];

	if ( ! ( self::is_term_edit( $pagenow ) || self::is_term_overview( $pagenow ) ) ) {
		return;
	}

	$asset_manager = new WPSEO_Admin_Asset_Manager();
	$asset_manager->enqueue_style( 'scoring' );
	$asset_manager->enqueue_style( 'monorepo' );

	$tag_id = filter_input( INPUT_GET, 'tag_ID' );
	if (
		self::is_term_edit( $pagenow )
		&& ! empty( $tag_id )  // After we drop support for <4.5 this can be removed.
	) {
		wp_enqueue_media(); // Enqueue files needed for upload functionality.

		$asset_manager->enqueue_style( 'metabox-css' );
		$asset_manager->enqueue_style( 'scoring' );
		$asset_manager->enqueue_script( 'term-edit' );

		$yoast_components_l10n = new WPSEO_Admin_Asset_Yoast_Components_L10n();
		$yoast_components_l10n->localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'term-edit' );

		$analysis_worker_location          = new WPSEO_Admin_Asset_Analysis_Worker_Location( $asset_manager->flatten_version( WPSEO_VERSION ) );
		$used_keywords_assessment_location = new WPSEO_Admin_Asset_Analysis_Worker_Location( $asset_manager->flatten_version( WPSEO_VERSION ), 'used-keywords-assessment' );

		/**
		 * Remove the emoji script as it is incompatible with both React and any
		 * contenteditable fields.
		 */
		remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );

		wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'term-edit', 'wpseoAdminL10n', WPSEO_Utils::get_admin_l10n() );
		wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'term-edit', 'wpseoFeaturesL10n', WPSEO_Utils::retrieve_enabled_features() );

		$script_data = [
			'analysis'         => [
				'plugins' => [
					'replaceVars' => [
						'no_parent_text'           => __( '(no parent)', 'wordpress-seo' ),
						'replace_vars'             => $this->get_replace_vars(),
						'recommended_replace_vars' => $this->get_recommended_replace_vars(),
						'scope'                    => $this->determine_scope(),
					],
				],
				'worker'  => [
					'url'                     => $analysis_worker_location->get_url(
						$analysis_worker_location->get_asset(),
						WPSEO_Admin_Asset::TYPE_JS
					),
					'keywords_assessment_url' => $used_keywords_assessment_location->get_url(
						$used_keywords_assessment_location->get_asset(),
						WPSEO_Admin_Asset::TYPE_JS
					),
					'log_level'               => WPSEO_Utils::get_analysis_worker_log_level(),
				],
			],
			'media'            => [
				// @todo replace this translation with JavaScript translations.
				'choose_image' => __( 'Use Image', 'wordpress-seo' ),
			],
			'metabox'          => $this->localize_term_scraper_script(),
			'userLanguageCode' => WPSEO_Language_Utils::get_language( WPSEO_Language_Utils::get_user_locale() ),
			'isTerm'           => true,
		];
		wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'term-edit', 'wpseoScriptData', $script_data );
	}

	if ( self::is_term_overview( $pagenow ) ) {
		$asset_manager->enqueue_script( 'edit-page-script' );
	}
}