Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




wp_script_is [ WordPress Function ]

wp_script_is ( $handle, $list = 'queue' )
Parameters:
  • (string) $handle Handle used to add script.
  • (string) $list Optional, defaults to 'queue'. Others values are 'registered', 'queue', 'done', 'to_do'
Returns:
  • (bool)
Defined at:



Check whether script has been added to WordPress Scripts.

The values for list defaults to 'queue', which is the same as enqueue for scripts.

Source


<?php
function wp_script_is$handle$list 'queue' ) {
    global 
$wp_scripts;
    if ( ! 
is_a$wp_scripts'WP_Scripts' ) ) {
        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_scripts = new WP_Scripts();
    }

    
$query $wp_scripts->query$handle$list );

    if ( 
is_object$query ) )
        return 
true;

    return 
$query;
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics