[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

title

Body

[close]

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

Dependencies API: Styles functions

File Size: 236 lines (8 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.

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.

param: string|bool|array $handles Styles to be printed. Default 'false'.
return: array On success, a processed array of 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.

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.

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: array            $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.

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.

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: array            $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.

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.

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 added.

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.

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 Apr 24 08:20:01 2019 Cross-referenced by PHPXref 0.7