Switch language

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




get_raw_theme_root [ WordPress Function ]

get_raw_theme_root ( $stylesheet_or_template, $skip_cache = false )
Parameters:
  • (string) $stylesheet_or_template The stylesheet or template name of the theme
  • (bool) $skip_cache Optional. Whether to skip the cache. Defaults to false, meaning the cache is used.
Returns:
  • (string) Theme root
Defined at:



Get the raw theme root relative to the content directory with no filters applied.

Source


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

    if ( 
count($wp_theme_directories) <= )
        return 
'/themes';

    
$theme_root false;

    
// If requesting the root for the current theme, consult options to avoid calling get_theme_roots()
    
if ( ! $skip_cache ) {
        if ( 
get_option('stylesheet') == $stylesheet_or_template )
            
$theme_root get_option('stylesheet_root');
        elseif ( 
get_option('template') == $stylesheet_or_template )
            
$theme_root get_option('template_root');
    }

    if ( empty(
$theme_root) ) {
        
$theme_roots get_theme_roots();
        if ( !empty(
$theme_roots[$stylesheet_or_template]) )
            
$theme_root $theme_roots[$stylesheet_or_template];
    }

    return 
$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