WPSEO_Admin_Pages::enqueue_tools_scripts()privateYoast 1.0

Enqueues and handles all the tool dependencies.

Метод класса: WPSEO_Admin_Pages{}

Хуков нет.

Возвращает

null. Ничего (null).

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

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

Код WPSEO_Admin_Pages::enqueue_tools_scripts() Yoast 22.4

private function enqueue_tools_scripts() {
	// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
	$tool = isset( $_GET['tool'] ) && is_string( $_GET['tool'] ) ? sanitize_text_field( wp_unslash( $_GET['tool'] ) ) : '';

	if ( empty( $tool ) ) {
		$this->asset_manager->enqueue_script( 'yoast-seo' );
	}

	if ( $tool === 'bulk-editor' ) {
		$this->asset_manager->enqueue_script( 'bulk-editor' );
	}
}