WP_Scripts::init() WordPress Method
The WP_Scripts::init() method is responsible for loading and initializing all the scripts used in a WordPress site. This includes both the core scripts and any external scripts loaded via the wp_enqueue_script() function.
WP_Scripts::init() #
Initialize the class.
Source
File: wp-includes/class.wp-scripts.php
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 ) ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
3.4.0 | Introduced. |