Changeset 14887
- Timestamp:
- 05/25/2010 03:36:23 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/query.php
r14750 r14887 146 146 * @return bool True if page is author or $author (if set). 147 147 */ 148 function is_author 148 function is_author($author = '') { 149 149 global $wp_query; 150 150 … … 181 181 * @return bool 182 182 */ 183 function is_category 183 function is_category($category = '') { 184 184 global $wp_query; 185 185 … … 410 410 * @return bool 411 411 */ 412 function is_page 412 function is_page($page = '') { 413 413 global $wp_query; 414 414 … … 530 530 return false; 531 531 532 if ( empty( 532 if ( empty($post) ) 533 533 return true; 534 534 … … 553 553 * @uses $wp_query 554 554 * 555 * @param string|array $post_types Optional. Post type or types to check in current query. 555 556 * @return bool 556 557 */ 557 function is_singular() { 558 global $wp_query; 559 560 return $wp_query->is_singular; 558 function is_singular($post_types = '') { 559 global $wp_query; 560 561 if ( empty($post_types) || !$wp_query->is_singular ) 562 return $wp_query->is_singular; 563 564 $post_obj = $wp_query->get_queried_object(); 565 566 return in_array($post_obj->post_type, (array) $post_types); 561 567 } 562 568 … … 1238 1244 * @param string|array $query 1239 1245 */ 1240 function parse_query($query 1246 function parse_query($query) { 1241 1247 if ( !empty($query) || !isset($this->query) ) { 1242 1248 $this->init();
Note: See TracChangeset
for help on using the changeset viewer.