get_theme_roots
Retrieve theme roots.
Description
(array|string) get_theme_roots();
Returns (array|string)
An array of theme roots keyed by template/stylesheet or a single theme root if all themes have the same root.
Usage
if ( !function_exists( 'get_theme_roots' ) ) { require_once ABSPATH . WPINC . '/theme.php'; } // NOTICE! Understand what this does before running. $result = get_theme_roots();
Defined (1)
The function is defined in the following location(s).
- /wp-includes/theme.php
- function get_theme_roots() {
- global $wp_theme_directories;
- if ( count($wp_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;
- }