_resolve_home_block_template(): array|null
- Since
- 6.0.0
- Source
wp-includes/deprecated.php:4617
Returns the correct template for the site's home page.
Return
array|null- A template object, or null if none could be found.
Uses · 3
- _deprecated_function()Marks a function as deprecated and inform when it has been used.
- get_option()Retrieves an option value based on an option name.
- resolve_block_template()Returns the correct 'wp_template' to render for the request template type.
Source
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, );}History
Introduced in 6.0.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
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.from the docblock
6.0.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-includes/deprecated.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.