Changeset 6704

Show
Ignore:
Timestamp:
02/02/08 00:13:34 (4 months ago)
Author:
ryan
Message:

is_front() from markjaquith and Nazgul. fixes #3682

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-includes/query.php

    r6688 r6704  
    135135} 
    136136 
     137/** 
     138 * is_front() - Is it the front of the site, whether blog view or a WP Page? 
     139 * 
     140 * @since 2.5 
     141 * @uses is_home 
     142 * @uses get_option 
     143 * 
     144 * @return bool True if front of site 
     145 */ 
     146function is_front () {  
     147    // most likely case  
     148    if ( 'posts' == get_option('show_on_front') && is_home() )  
     149        return true;  
     150    elseif ( 'page' == get_option('show_on_front') && get_option('page_on_front') && is_page(get_option('page_on_front')) )  
     151        return true;  
     152    else  
     153        return false;  
     154}  
     155 
     156/** 
     157 * is_home() - Is it the blog view homepage? 
     158 * 
     159 * @since 2.1 
     160 * @global object $wp_query 
     161 * 
     162 * @return bool True if blog view homepage 
     163 */ 
    137164function is_home () { 
    138165    global $wp_query;