WP_Styles
- Since
- 2.6.0
- Source
wp-includes/class-wp-styles.php:18
Core class used to register styles.
Compatibility
- WordPress
- since 2.6.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Hooks and filters fired · 5
Every hook that fires from inside WP_Styles, in the order it appears in the class, grouped by the method that fires it.
WP_Styles::__construct()
- do_action( wp_default_styles )action line 135
WP_Styles::do_item()
- apply_filters( style_loader_tag )filter line 251
- apply_filters( style_loader_tag )filter line 272
WP_Styles::all_deps()
- apply_filters( print_styles_array )filter line 380
WP_Styles::_css_href()
- apply_filters( style_loader_src )filter line 412
Properties · 11
$base_urlstringpublic- Base URL for styles.
$content_urlstringpublic- URL of the content directory.
$default_versionstringpublic- Default version string for stylesheets.
$text_directionstringpublic- The current text direction.
$concatstringpublic- Holds a list of style handles which will be concatenated.
$concat_versionstringpublic- Holds a string which contains style handles and their version.
$do_concatboolpublic- Whether to perform concatenation.
$print_htmlstringpublic- Holds HTML markup of styles and additional data if concatenation is enabled.
$print_codestringpublic- Holds inline styles if concatenation is enabled.
$default_dirsarraypublic- List of default directories.
$type_attrstringprivate- Holds a string which contains the type attribute for style tag.
Methods · 9
- __construct()Constructor.
- do_item()Processes a style dependency.
- add_inline_style()Adds extra CSS styles to a registered stylesheet.
- print_inline_style()Prints extra CSS styles of a registered stylesheet.
- all_deps()Determines style dependencies.
- _css_href()Generates an enqueued style's fully-qualified URL.
- in_default_dir()Whether a handle's source is in a default directory.
- do_footer_items()Processes items and dependencies for the footer group.
- reset()Resets class properties.
Source code
class WP_Styles extends WP_Dependencies { /** * Base URL for styles. * * Full URL with trailing slash. * * @since 2.6.0 * @var string */ public $base_url; /** * URL of the content directory. * * @since 2.8.0 * @var string */ public $content_url; /** * Default version string for stylesheets. * * @since 2.6.0 * @var string */ public $default_version; /** * The current text direction. * * @since 2.6.0 * @var string */ public $text_direction = 'ltr'; /** * Holds a list of style handles which will be concatenated. * * @since 2.8.0 * @var string */ public $concat = ''; /** * Holds a string which contains style handles and their version. * * @since 2.8.0 * @deprecated 3.4.0 * @var string */ public $concat_version = ''; /** * Whether to perform concatenation. * * @since 2.8.0 * @var bool */ public $do_concat = false; /** * Holds HTML markup of styles and additional data if concatenation * is enabled. * * @since 2.8.0 * @var string */ public $print_html = ''; /** * Holds inline styles if concatenation is enabled. * * @since 3.3.0 * @var string */ public $print_code = ''; /** * List of default directories. *Changelog
Introduced in 2.6.0. 2 changes between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
6.9.7
Method
add_data() added.verified against source6.9.7
Method
get_dependency_warning_message() added.verified against source2.6.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 6.8.8 tag, from
src/wp-includes/class-wp-styles.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.