Switch language

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




get_theme_root [ WordPress Function ]

get_theme_root ( $stylesheet_or_template = false )
Parameters:
  • (string) $stylesheet_or_template The stylesheet or template name of the theme
Uses:
Returns:
  • (string) Theme path.
Defined at:



Retrieve path to themes directory.

Does not have trailing slash.

Source


<?php
function get_theme_root$stylesheet_or_template false ) {
    global 
$wp_theme_directories;

    if ( 
$stylesheet_or_template && $theme_root get_raw_theme_root$stylesheet_or_template ) ) {
        
// Always prepend WP_CONTENT_DIR unless the root currently registered as a theme directory.
        // This gives relative theme roots the benefit of the doubt when things go haywire.
        
if ( ! in_array$theme_root, (array) $wp_theme_directories ) )
            
$theme_root WP_CONTENT_DIR $theme_root;
    } else {
        
$theme_root WP_CONTENT_DIR '/themes';
    }

    return 
apply_filters'theme_root'$theme_root );
}
?>

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