On this page
WP_Styles::__construct()
Constructor.
Source
File: wp-includes/class-wp-styles.php. View all references
public function __construct() {
if (
function_exists( 'is_admin' ) && ! is_admin()
&&
function_exists( 'current_theme_supports' ) && ! current_theme_supports( 'html5', 'style' )
) {
$this->type_attr = " type='text/css'";
}
/**
* Fires when the WP_Styles instance is initialized.
*
* @since 2.6.0
*
* @param WP_Styles $wp_styles WP_Styles instance (passed by reference).
*/
do_action_ref_array( 'wp_default_styles', array( &$this ) );
}
Hooks
- do_action_ref_array( 'wp_default_styles',
WP_Styles $wp_styles ) -
Fires when the WP_Styles instance is initialized.
Related
Uses
| Uses | Description |
|---|---|
| do_action_ref_array() wp-includes/plugin.php | Calls the callback functions that have been added to an action hook, specifying arguments in an array. |
| current_theme_supports() wp-includes/theme.php | Checks a theme’s support for a given feature. |
| is_admin() wp-includes/load.php | Determines whether the current request is for an administrative interface page. |
Used By
| Used By | Description |
|---|---|
| wp_styles() wp-includes/functions.wp-styles.php | Initialize $wp_styles if it has not been set. |
Changelog
| Version | Description |
|---|---|
| 2.6.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_styles/__construct