Changeset 21672 for trunk/wp-includes/functions.wp-scripts.php
- Timestamp:
- 08/30/2012 06:57:57 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.wp-scripts.php
r19687 r21672 162 162 * Check whether script has been added to WordPress Scripts. 163 163 * 164 * The values for list defaults to 'queue', which is the same as enqueue for 165 * scripts. 164 * By default, checks if the script has been enqueued. You can also 165 * pass 'registered' to $list, to see if the script is registered, 166 * and you can check processing statuses with 'to_do' and 'done'. 166 167 * 167 168 * @since WP unknown; BP unknown 168 169 * 169 * @param string $handle Handle used to add script. 170 * @param string $list Optional, defaults to 'queue'. Others values are 'registered', 'queue', 'done', 'to_do' 171 * @return bool 170 * @param string $handle Name of the script. 171 * @param string $list Optional. Defaults to 'enqueued'. Values are 172 * 'registered', 'enqueued' (or 'queue'), 'to_do', and 'done'. 173 * @return bool Whether script is in the list. 172 174 */ 173 function wp_script_is( $handle, $list = ' queue' ) {175 function wp_script_is( $handle, $list = 'enqueued' ) { 174 176 global $wp_scripts; 175 177 if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) { … … 180 182 } 181 183 182 $query = $wp_scripts->query( $handle, $list ); 183 184 if ( is_object( $query ) ) 185 return true; 186 187 return $query; 184 return (bool) $wp_scripts->query( $handle, $list ); 188 185 }
Note: See TracChangeset
for help on using the changeset viewer.