Changeset 6823
- Timestamp:
- 02/13/2008 07:02:08 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/query.php
r6763 r6823 66 66 $author_obj = $wp_query->get_queried_object(); 67 67 68 if ( $author == $author_obj->ID ) 69 return true; 70 elseif ( $author == $author_obj->nickname ) 71 return true; 72 elseif ( $author == $author_obj->user_nicename ) 68 $author = (array) $author; 69 70 if ( in_array( $author_obj->ID, $author ) ) 71 return true; 72 elseif ( in_array( $author_obj->nickname, $author ) ) 73 return true; 74 elseif ( in_array( $author_obj->user_nicename, $author ) ) 73 75 return true; 74 76 … … 87 89 $cat_obj = $wp_query->get_queried_object(); 88 90 89 if ( $category == $cat_obj->term_id ) 90 return true; 91 else if ( $category == $cat_obj->name ) 92 return true; 93 elseif ( $category == $cat_obj->slug ) 91 $category = (array) $category; 92 93 if ( in_array( $cat_obj->term_id, $category ) ) 94 return true; 95 elseif ( in_array( $cat_obj->name, $category ) ) 96 return true; 97 elseif ( in_array( $cat_obj->slug, $category ) ) 94 98 return true; 95 99 … … 99 103 function is_tag( $slug = '' ) { 100 104 global $wp_query; 105 101 106 if ( !$wp_query->is_tag ) 102 107 return false; … … 106 111 107 112 $tag_obj = $wp_query->get_queried_object(); 108 if ( $slug == $tag_obj->slug ) 109 return true; 113 114 $slug = (array) $slug; 115 116 if ( in_array( $tag_obj->slug, $slug ) ) 117 return true; 118 110 119 return false; 111 120 } … … 241 250 $post_obj = $wp_query->get_queried_object(); 242 251 243 if ( $post == $post_obj->ID ) 244 return true; 245 elseif ( $post == $post_obj->post_title ) 246 return true; 247 elseif ( $post == $post_obj->post_name ) 252 $post = (array) $post; 253 254 if ( in_array( $post_obj->ID, $post ) ) 255 return true; 256 elseif ( in_array( $post_obj->post_title, $post ) ) 257 return true; 258 elseif ( in_array( $post_obj->post_name, $post ) ) 248 259 return true; 249 260
Note: See TracChangeset
for help on using the changeset viewer.