Welcome, visitor! Log in
 

Source View: page_template

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.

  • Action hooks look like this: do_action( "hook_name" )
  • Filter hooks look like this: apply_filters( "hook_name", "what_to_filter" ).

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
1682       global $wp_query;
1683  
1684       $id = $wp_query->post->ID;     
1685       $template = get_post_meta($id, '_wp_page_template', true);
1686  
1687       if ( 'default' == $template )
1688            $template = '';
1689  
1690       if ( ! empty($template) && file_exists(TEMPLATEPATH . "/$template") )
1691            $template = TEMPLATEPATH . "/$template";
1692       else if ( file_exists(TEMPLATEPATH .  "/page.php") )
1693            $template = TEMPLATEPATH .  "/page.php";
1694       else
1695            $template = '';
1696  
1697       return apply_filters('page_template', $template);
1698  }
1699  
1700  function get_paged_template() {
1701       return get_query_template('paged');
1702  }
1703  
1704  function get_search_template() {
1705       return get_query_template('search');
1706  }
1707  
1708  function get_single_template() {
1709       return get_query_template('single');
1710  }
1711  
1712  function get_comments_popup_template() {