WordPress.org

Make WordPress Core

Ticket #6801: 6801.003.2.diff

File 6801.003.2.diff, 1.2 KB (added by AaronCampbell, 10 years ago)
  • trunk/wp-includes/template-loader.php

     
    2626        } else if ( is_home() && $template = get_home_template() ) {
    2727                include($template);
    2828                return;
     29        } else if ( is_front_page() && $template = get_static_front_page_template() ) {
     30                include($template);
     31                return;
    2932        } else if ( is_attachment() && $template = get_attachment_template() ) {
    3033                remove_filter('the_content', 'prepend_attachment');
    3134                include($template);
  • trunk/wp-includes/theme.php

     
    399399        return get_query_template('date');
    400400}
    401401
     402function get_static_front_page_template() {
     403        $template = '';
     404
     405        $template = get_page_template();
     406        if ( in_array($template, array('page.php', '')) && file_exists(TEMPLATEPATH . "/front-page.php") ) {
     407                $template = TEMPLATEPATH . "/front-page.php";
     408        }
     409
     410        return apply_filters('static_front_page_template', $template);
     411}
     412
    402413function get_home_template() {
    403414        $template = '';
    404415