Ticket #21394: 21394.diff
File 21394.diff, 1.9 KB (added by , 12 years ago) |
---|
-
wp-includes/query.php
3119 3119 return true; 3120 3120 3121 3121 $author_obj = $this->get_queried_object(); 3122 if ( empty( $author_obj ) ) 3123 return false; 3122 3124 3123 3125 $author = (array) $author; 3124 3126 … … 3144 3146 * @return bool 3145 3147 */ 3146 3148 function is_category( $category = '' ) { 3147 if ( ! $this->is_category )3149 if ( ! $this->is_category ) 3148 3150 return false; 3149 3151 3150 if ( empty( $category) )3152 if ( empty( $category ) ) 3151 3153 return true; 3152 3154 3153 3155 $cat_obj = $this->get_queried_object(); 3156 if ( empty( $cat_obj ) ) 3157 return false; 3154 3158 3155 3159 $category = (array) $category; 3156 3160 … … 3176 3180 * @return bool 3177 3181 */ 3178 3182 function is_tag( $slug = '' ) { 3179 if ( ! $this->is_tag )3183 if ( ! $this->is_tag ) 3180 3184 return false; 3181 3185 3182 3186 if ( empty( $slug ) ) 3183 3187 return true; 3184 3188 3185 3189 $tag_obj = $this->get_queried_object(); 3190 if ( empty( $tag_obj ) ) 3191 return false; 3186 3192 3187 3193 $slug = (array) $slug; 3188 3194 … … 3371 3377 * @return bool 3372 3378 */ 3373 3379 function is_page( $page = '' ) { 3374 if ( ! $this->is_page )3380 if ( ! $this->is_page ) 3375 3381 return false; 3376 3382 3377 3383 if ( empty( $page ) ) 3378 3384 return true; 3379 3385 3380 3386 $page_obj = $this->get_queried_object(); 3387 if ( empty( $page_obj ) ) 3388 return false; 3381 3389 3382 3390 $page = (array) $page; 3383 3391 … … 3452 3460 * @return bool 3453 3461 */ 3454 3462 function is_single( $post = '' ) { 3455 if ( ! $this->is_single )3463 if ( ! $this->is_single ) 3456 3464 return false; 3457 3465 3458 if ( empty( $post) )3466 if ( empty( $post ) ) 3459 3467 return true; 3460 3468 3461 3469 $post_obj = $this->get_queried_object(); 3470 if ( empty( $post_obj ) ) 3471 return false; 3462 3472 3463 3473 $post = (array) $post; 3464 3474 … … 3491 3501 return (bool) $this->is_singular; 3492 3502 3493 3503 $post_obj = $this->get_queried_object(); 3504 if ( empty( $post_obj ) ) 3505 return false; 3494 3506 3495 3507 return in_array( $post_obj->post_type, (array) $post_types ); 3496 3508 }