wpseek.com
WordPress开发者和主题制作者的搜索引擎



get_theme_roots › WordPress Function

Since2.9.0
已弃用n/a
get_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.
定义在:
文档:

Retrieves theme roots.



源码

function get_theme_roots() {
	global $wp_theme_directories;

	if ( ! is_array( $wp_theme_directories ) || 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;
}