wp_style_is

Definition:
function wp_style_is( $handle, $list = 'queue' ) {}

Check whether style has been added to WordPress Styles.
The values for list defaults to ‘queue’, which is the same as wp_enqueue_style().

Parameters

  • string $handle: Name of the stylesheet.
  • string $list: Values are ‘registered’, ‘done’, ‘queue’ and ‘to_do’.

Return values

returns:True on success, false on failure.

Source code

function wp_style_is( $handle, $list = 'queue' ) {

	global $wp_styles;

	if ( ! is_a( $wp_styles, 'WP_Styles' ) ) {

		if ( ! did_action( 'init' ) )

			_doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),

				'<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>' ), '3.3' );

		$wp_styles = new WP_Styles();

	}



	$query = $wp_styles->query( $handle, $list );



	if ( is_object( $query ) )

		return true;



	return $query;

}

4149

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: