get_theme_roots()
最后更新于:2021-11-27 01:00:22
get_theme_roots()Retrieves theme roots.
响应
(array|string) An array of theme roots keyed by template/stylesheet or a single theme root if all themes have the same root.
源文件
文件: gc-includes/theme.php
function get_theme_roots() {
global $gc_theme_directories;
if ( ! is_array( $gc_theme_directories ) || count( $gc_theme_directories ) <= 1 ) {
return '/themes';
}
$theme_roots = get_site_transient( 'theme_roots' );
if ( false === $theme_roots ) {
search_theme_directories( true ); // Regenerate the transient.
$theme_roots = get_site_transient( 'theme_roots' );
}
return $theme_roots;
}