[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/ -> functions.wp-styles.php (summary)

Dependencies API: Styles functions

File Size: 245 lines (9 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 9 functions

  wp_styles()
  wp_print_styles()
  wp_add_inline_style()
  wp_register_style()
  wp_deregister_style()
  wp_enqueue_style()
  wp_dequeue_style()
  wp_style_is()
  wp_style_add_data()

Functions
Functions that are not part of a class:

wp_styles()   X-Ref
Initialize $wp_styles if it has not been set.

since: 4.2.0
return: WP_Styles WP_Styles instance.

wp_print_styles( $handles = false )   X-Ref
Display styles that are in the $handles queue.

Passing an empty array to $handles prints the queue,
passing an array with one string prints that style,
and passing an array of strings prints those styles.

since: 2.6.0
param: string|bool|array $handles Styles to be printed. Default 'false'.
return: string[] On success, an array of handles of processed WP_Dependencies items; otherwise, an empty array.

wp_add_inline_style( $handle, $data )   X-Ref
Add extra CSS styles to a registered stylesheet.

Styles will only be added if the stylesheet is already in the queue.
Accepts a string $data containing the CSS. If two or more CSS code blocks
are added to the same stylesheet $handle, they will be printed in the order
they were added, i.e. the latter added styles can redeclare the previous.

since: 3.3.0
param: string $handle Name of the stylesheet to add the extra styles to.
param: string $data   String containing the CSS styles to be added.
return: bool True on success, false on failure.

wp_register_style( $handle, $src, $deps = array()   X-Ref
Register a CSS stylesheet.

since: 2.6.0
since: 4.3.0 A return value was added.
param: string           $handle Name of the stylesheet. Should be unique.
param: string|bool      $src    Full URL of the stylesheet, or path of the stylesheet relative to the WordPress root directory.
param: string[]         $deps   Optional. An array of registered stylesheet handles this stylesheet depends on. Default empty array.
param: string|bool|null $ver    Optional. String specifying stylesheet version number, if it has one, which is added to the URL
param: string           $media  Optional. The media for which this stylesheet has been defined.
return: bool Whether the style has been registered. True on success, false on failure.

wp_deregister_style( $handle )   X-Ref
Remove a registered stylesheet.

since: 2.1.0
param: string $handle Name of the stylesheet to be removed.

wp_enqueue_style( $handle, $src = '', $deps = array()   X-Ref
Enqueue a CSS stylesheet.

Registers the style if source provided (does NOT overwrite) and enqueues.

since: 2.6.0
param: string           $handle Name of the stylesheet. Should be unique.
param: string           $src    Full URL of the stylesheet, or path of the stylesheet relative to the WordPress root directory.
param: string[]         $deps   Optional. An array of registered stylesheet handles this stylesheet depends on. Default empty array.
param: string|bool|null $ver    Optional. String specifying stylesheet version number, if it has one, which is added to the URL
param: string           $media  Optional. The media for which this stylesheet has been defined.

wp_dequeue_style( $handle )   X-Ref
Remove a previously enqueued CSS stylesheet.

since: 3.1.0
param: string $handle Name of the stylesheet to be removed.

wp_style_is( $handle, $list = 'enqueued' )   X-Ref
Check whether a CSS stylesheet has been added to the queue.

since: 2.8.0
param: string $handle Name of the stylesheet.
param: string $list   Optional. Status of the stylesheet to check. Default 'enqueued'.
return: bool Whether style is queued.

wp_style_add_data( $handle, $key, $value )   X-Ref
Add metadata to a CSS stylesheet.

Works only if the stylesheet has already been registered.

Possible values for $key and $value:
'conditional' string      Comments for IE 6, lte IE 7 etc.
'rtl'         bool|string To declare an RTL stylesheet.
'suffix'      string      Optional suffix, used in combination with RTL.
'alt'         bool        For rel="alternate stylesheet".
'title'       string      For preferred/alternate stylesheets.
'path'        string      The absolute path to a stylesheet. Stylesheet will
load inline when 'path'' is set.

since: 3.6.0
since: 5.8.0 Added 'path' as an official value for $key.
param: string $handle Name of the stylesheet.
param: string $key    Name of data point for which we're storing a value.
param: mixed  $value  String containing the CSS data to be added.
return: bool True on success, false on failure.



Generated: Wed Nov 6 01:00:02 2024 Cross-referenced by PHPXref 0.7.1