[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

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
Initializes $wp_styles if it has not been set.

return: WP_Styles WP_Styles instance.

wp_print_styles( $handles = false )   X-Ref
Displays 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.

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

wp_add_inline_style( $handle, $data )   X-Ref
Adds 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.

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

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

return: bool Whether the style has been registered. True on success, false on failure.
param: string           $handle Name of the stylesheet. Should be unique.
param: string|false     $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_deregister_style( $handle )   X-Ref
Removes a registered stylesheet.

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

wp_enqueue_style( $handle, $src = '', $deps = array()   X-Ref
Enqueues 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: 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
Removes a previously enqueued CSS stylesheet.

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

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

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

wp_style_add_data( $handle, $key, $value )   X-Ref
Adds 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.

return: bool True on success, false on failure.
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.



Generated : Sat Dec 21 08:20:01 2024 Cross-referenced by PHPXref