]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/functions.wp-styles.php
Wordpress 3.5.2
[autoinstalls/wordpress.git] / wp-includes / functions.wp-styles.php
index db8b583e98f6a6ce6fb490f4e82e06e014d3abaa..49095f3b7ae16a90f22f80678789e01a63e757c6 100644 (file)
@@ -47,7 +47,7 @@ function wp_print_styles( $handles = false ) {
  * 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
+ * @since 3.3.0
  * @see WP_Scripts::add_inline_style()
  */
 function wp_add_inline_style( $handle, $data ) {
@@ -74,7 +74,7 @@ function wp_add_inline_style( $handle, $data ) {
  * @param string|bool $src Path to the stylesheet from the root directory of WordPress. Example: '/css/mystyle.css'.
  * @param array $deps Array of handles of any stylesheet that this stylesheet depends on.
  *  (Stylesheets that must be loaded before this stylesheet.) Pass an empty array if there are no dependencies.
- * @param string|bool $ver String specifying the stylesheet version number. Set to NULL to disable.
+ * @param string|bool $ver String specifying the stylesheet version number. Set to null to disable.
  *  Used to ensure that the correct version is sent to the client regardless of caching.
  * @param string $media The media for which this stylesheet has been defined.
  */
@@ -167,16 +167,19 @@ function wp_dequeue_style( $handle ) {
 /**
  * Check whether style has been added to WordPress Styles.
  *
- * The values for list defaults to 'queue', which is the same as wp_enqueue_style().
+ * By default, checks if the style has been enqueued. You can also
+ * pass 'registered' to $list, to see if the style is registered,
+ * and you can check processing statuses with 'to_do' and 'done'.
  *
  * @since WP unknown; BP unknown
  * @global object $wp_styles The WP_Styles object for printing styles.
  *
  * @param string $handle Name of the stylesheet.
- * @param string $list Values are 'registered', 'done', 'queue' and 'to_do'.
- * @return bool True on success, false on failure.
+ * @param string $list Optional. Defaults to 'enqueued'. Values are
+ *     'registered', 'enqueued' (or 'queue'), 'to_do', and 'done'.
+ * @return bool Whether style is in the list.
  */
-function wp_style_is( $handle, $list = 'queue' ) {
+function wp_style_is( $handle, $list = 'enqueued' ) {
        global $wp_styles;
        if ( ! is_a( $wp_styles, 'WP_Styles' ) ) {
                if ( ! did_action( 'init' ) )
@@ -185,10 +188,5 @@ function wp_style_is( $handle, $list = 'queue' ) {
                $wp_styles = new WP_Styles();
        }
 
-       $query = $wp_styles->query( $handle, $list );
-
-       if ( is_object( $query ) )
-               return true;
-
-       return $query;
+       return (bool) $wp_styles->query( $handle, $list );
 }