WP_Scripts::init()publicWP 3.4.0

Initialize the class.

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

Хуки из метода

Возвращает

null. Ничего.

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

global $wp_scripts;
$wp_scripts->init();

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

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

Код WP_Scripts::init() WP 6.1.1

public function init() {
	if (
		function_exists( 'is_admin' ) && ! is_admin()
	&&
		function_exists( 'current_theme_supports' ) && ! current_theme_supports( 'html5', 'script' )
	) {
		$this->type_attr = " type='text/javascript'";
	}

	/**
	 * Fires when the WP_Scripts instance is initialized.
	 *
	 * @since 2.6.0
	 *
	 * @param WP_Scripts $wp_scripts WP_Scripts instance (passed by reference).
	 */
	do_action_ref_array( 'wp_default_scripts', array( &$this ) );
}