функция
Устаревший since 6.0.0
_resolve_home_block_template()
Устаревшее.
Помечено устаревшим с версии 6.2.0.
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
_resolve_home_block_template(): array|null
Описание
Возвращает правильный шаблон для главной страницы сайта.
Возвращаемое значение
array|null
Исходный код
wp-includes/deprecated.php:4617
function _resolve_home_block_template() {
_deprecated_function( __FUNCTION__, '6.2.0' );
$show_on_front = get_option( 'show_on_front' );
$front_page_id = get_option( 'page_on_front' );
if ( 'page' === $show_on_front && $front_page_id ) {
return array(
'postType' => 'page',
'postId' => $front_page_id,
);
}
$hierarchy = array( 'front-page', 'home', 'index' );
$template = resolve_block_template( 'home', $hierarchy, '' );
if ( ! $template ) {
return null;
}
return array(
'postType' => 'wp_template',
'postId' => $template->id,
);
}
История изменений
| Версия | Описание |
|---|---|
| 6.2.0 | Deprecated. Site Editor’s server-side redirect for missing postType and postId query args is removed. Thus, this function is no longer used. |
| 6.0.0 | Introduced. |

