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

Yoast\WP\SEO\Integrations\Third_Party

Elementor::enqueue() public Yoast 1.0

Enqueues all the needed JS and CSS.

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

Хуков нет.

Возвращает

null. Ничего.

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

$Elementor = new Elementor();
$Elementor->enqueue();

Код Elementor::enqueue() Yoast 16.8

<?php
public function enqueue() {
	$post_id = \get_queried_object_id();
	if ( empty( $post_id ) ) {
		$post_id = \sanitize_text_field( \filter_input( \INPUT_GET, 'post' ) );
	}

	if ( $post_id !== 0 ) {
		// Enqueue files needed for upload functionality.
		\wp_enqueue_media( [ 'post' => $post_id ] );
	}

	$this->asset_manager->enqueue_style( 'admin-global' );
	$this->asset_manager->enqueue_style( 'metabox-css' );
	$this->asset_manager->enqueue_style( 'scoring' );
	$this->asset_manager->enqueue_style( 'select2' );
	$this->asset_manager->enqueue_style( 'monorepo' );
	$this->asset_manager->enqueue_style( 'admin-css' );
	$this->asset_manager->enqueue_style( 'elementor' );

	$this->asset_manager->enqueue_script( 'elementor' );

	$yoast_components_l10n = new WPSEO_Admin_Asset_Yoast_Components_L10n();
	$yoast_components_l10n->localize_script( 'elementor' );

	$this->asset_manager->localize_script( 'elementor', 'wpseoAdminL10n', WPSEO_Utils::get_admin_l10n() );
	$this->asset_manager->localize_script( 'elementor', 'wpseoFeaturesL10n', WPSEO_Utils::retrieve_enabled_features() );

	$plugins_script_data = [
		'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(),
			'has_taxonomies'           => $this->current_post_type_has_taxonomies(),
		],
		'shortcodes'  => [
			'wpseo_filter_shortcodes_nonce' => \wp_create_nonce( 'wpseo-filter-shortcodes' ),
			'wpseo_shortcode_tags'          => $this->get_valid_shortcode_tags(),
		],
	];

	$worker_script_data = [
		'url'                     => YoastSEO()->helpers->asset->get_asset_url( 'yoast-seo-analysis-worker' ),
		'dependencies'            => YoastSEO()->helpers->asset->get_dependency_urls_by_handle( 'yoast-seo-analysis-worker' ),
		'keywords_assessment_url' => YoastSEO()->helpers->asset->get_asset_url( 'yoast-seo-used-keywords-assessment' ),
		'log_level'               => WPSEO_Utils::get_analysis_worker_log_level(),
		// We need to make the feature flags separately available inside of the analysis web worker.
		'enabled_features'        => WPSEO_Utils::retrieve_enabled_features(),
	];

	$alert_dismissal_action = \YoastSEO()->classes->get( Alert_Dismissal_Action::class );
	$dismissed_alerts       = $alert_dismissal_action->all_dismissed();

	$script_data = [
		'media'             => [ 'choose_image' => \__( 'Use Image', 'wordpress-seo' ) ],
		'metabox'           => $this->get_metabox_script_data(),
		'userLanguageCode'  => WPSEO_Language_Utils::get_language( \get_user_locale() ),
		'isPost'            => true,
		'isBlockEditor'     => WP_Screen::get()->is_block_editor(),
		'isElementorEditor' => true,
		'analysis'          => [
			'plugins'                     => $plugins_script_data,
			'worker'                      => $worker_script_data,
			'estimatedReadingTimeEnabled' => $this->estimated_reading_time_conditional->is_met(),
		],
		'dismissedAlerts'   => $dismissed_alerts,
	];

	if ( \post_type_supports( $this->get_metabox_post()->post_type, 'thumbnail' ) ) {
		$this->asset_manager->enqueue_style( 'featured-image' );

		$script_data['featuredImage'] = [
			'featured_image_notice' => \__( 'SEO issue: The featured image should be at least 200 by 200 pixels to be picked up by Facebook and other social media sites.', 'wordpress-seo' ),
		];
	}

	$this->asset_manager->localize_script( 'elementor', 'wpseoScriptData', $script_data );
	$this->asset_manager->enqueue_user_language_script();
}