функция
since 2.9.0
get_theme_roots()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
get_theme_roots(): array|string
Описание
Возвращает корневые каталоги тем.
Возвращаемое значение
array|string
Исходный код
wp-includes/theme.php:388
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;
}
История изменений
| Версия | Описание |
|---|---|
| 2.9.0 | Introduced. |

