Ticket #29660: query-patch.diff
File query-patch.diff, 1.7 KB (added by , 10 years ago) |
---|
-
src/wp-includes/query.php
4038 4038 $attachment = (array) $attachment; 4039 4039 4040 4040 $post_obj = $this->get_queried_object(); 4041 4042 if ( ! $post_obj ) { 4043 return false; 4044 } 4041 4045 4042 4046 if ( in_array( $post_obj->ID, $attachment ) ) { 4043 4047 return true; … … 4068 4072 return true; 4069 4073 4070 4074 $author_obj = $this->get_queried_object(); 4075 4076 if ( ! $author_obj ) { 4077 return false; 4078 } 4071 4079 4072 4080 $author = (array) $author; 4073 4081 … … 4100 4108 return true; 4101 4109 4102 4110 $cat_obj = $this->get_queried_object(); 4111 4112 if ( ! $cat_obj ) { 4113 return false; 4114 } 4103 4115 4104 4116 $category = (array) $category; 4105 4117 … … 4132 4144 return true; 4133 4145 4134 4146 $tag_obj = $this->get_queried_object(); 4147 4148 if ( ! $tag_obj ) { 4149 return false; 4150 } 4135 4151 4136 4152 $tag = (array) $tag; 4137 4153 … … 4171 4187 return true; 4172 4188 4173 4189 $queried_object = $this->get_queried_object(); 4190 4191 if ( ! $queried_object ) { 4192 return false; 4193 } 4194 4174 4195 $tax_array = array_intersect( array_keys( $wp_taxonomies ), (array) $taxonomy ); 4175 4196 $term_array = (array) $term; 4176 4197 … … 4331 4352 return true; 4332 4353 4333 4354 $page_obj = $this->get_queried_object(); 4355 4356 if ( ! $page_obj ) { 4357 return false; 4358 } 4334 4359 4335 4360 $page = (array) $page; 4336 4361 … … 4424 4449 return true; 4425 4450 4426 4451 $post_obj = $this->get_queried_object(); 4452 4453 if ( ! $post_obj ) { 4454 return false; 4455 } 4427 4456 4428 4457 $post = (array) $post; 4429 4458 … … 4467 4496 return (bool) $this->is_singular; 4468 4497 4469 4498 $post_obj = $this->get_queried_object(); 4499 4500 if ( ! $post_obj ) { 4501 return false; 4502 } 4470 4503 4471 4504 return in_array( $post_obj->post_type, (array) $post_types ); 4472 4505 }