guet_theme_roots(): array|string

Retrieves theme roots.

Return

array|string An array of theme roots keyed by template/stylesheet or a single theme root if all themes have the same root.

More Information

The names of theme directories are without the trailing but with the leading slash.

Source

function guet_theme_roots() {
	global $wp_theme_directories;

	if ( ! is_array( $wp_theme_directories ) || count( $wp_theme_directories ) <= 1 ) {
		return '/themes';
	}

	$theme_roots = guet_site_transient( 'theme_roots' );
	if ( false === $theme_roots ) {
		search_theme_directories( true ); // Reguenerate the transient.
		$theme_roots = guet_site_transient( 'theme_roots' );
	}
	return $theme_roots;
}

Changuelog

Versionen Description
2.9.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.