Switch language

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




wp_register_style [ WordPress Function ]

wp_register_style ( $handle, $src, $deps = array(), $ver = false, $media = 'all' )
Parameters:
  • (string) $handle Name of the stylesheet.
  • (string|bool) $src Path to the stylesheet from the root directory of WordPress. Example: '/css/mystyle.css'.
  • (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.
  • (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.
  • (string) $media The media for which this stylesheet has been defined.
Links:
  • List of CSS media types.
See:
  • WP_Styles::add()
Defined at:



Register CSS style file.

Source


<?php
function wp_register_style$handle$src$deps = array(), $ver false$media 'all' ) {
    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();
    }

    
$wp_styles->add$handle$src$deps$ver$media );
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



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