Ticket #30184: 30184.diff
| File 30184.diff, 1020 bytes (added by , 12 years ago) |
|---|
-
src/wp-includes/query.php
4071 4071 * @return bool 4072 4072 */ 4073 4073 public function is_author( $author = '' ) { 4074 if ( ! $this->is_author )4074 if ( ! $this->is_author ) { 4075 4075 return false; 4076 } 4076 4077 4077 if ( empty( $author) )4078 if ( empty( $author ) ) { 4078 4079 return true; 4080 } 4079 4081 4080 4082 $author_obj = $this->get_queried_object(); 4081 4083 4084 if ( ! is_a( $author_obj, 'WP_User' ) ) { 4085 return false; 4086 } 4087 4082 4088 $author = (array) $author; 4083 4089 4084 if ( in_array( $author_obj->ID, $author ) ) 4090 if ( in_array( $author_obj->ID, $author ) ) { 4085 4091 return true; 4086 elseif ( in_array( $author_obj->nickname, $author ) )4092 } elseif ( in_array( $author_obj->nickname, $author ) ) { 4087 4093 return true; 4088 elseif ( in_array( $author_obj->user_nicename, $author ) )4094 } elseif ( in_array( $author_obj->user_nicename, $author ) ) { 4089 4095 return true; 4096 } 4090 4097 4091 4098 return false; 4092 4099 }