Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: frontpage_template_hierarchy

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
1585           /** This filter is documented in wp-includes/template.php */
1586           return apply_filters( 'index_template_hierarchy', array( 'index' ) );
1587      }
1588      if ( $is_custom ) {
1589           /** This filter is documented in wp-includes/template.php */
1590           return apply_filters( 'page_template_hierarchy', array( 'page', 'singular', 'index' ) );
1591      }
1592      if ( 'front-page' === $slug ) {
1593           /** This filter is documented in wp-includes/template.php */
1594           return apply_filters( 'frontpage_template_hierarchy', array( 'front-page', 'home', 'index' ) );
1595      }
1596
1597      $matches = array();
1598
1599      $template_hierarchy = array( $slug );
1600      // Most default templates don't have `$template_prefix` assigned.
1601      if ( ! empty( $template_prefix ) ) {
1602           list( $type ) = explode( '-', $template_prefix );
1603           // We need these checks because we always add the `$slug` above.