Changeset 4180
- Timestamp:
- 09/10/2006 05:47:49 PM (18 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post-template.php
r4165 r4180 266 266 267 267 $defaults = array('depth' => 0, 'show_date' => '', 'date_format' => get_option('date_format'), 268 'child_of' => 0, 'title_li' => __('Pages'), 'echo' => 1 );268 'child_of' => 0, 'title_li' => __('Pages'), 'echo' => 1, 'authors' => ''); 269 269 $r = array_merge($defaults, $r); 270 270 -
trunk/wp-includes/post.php
r4159 r4180 1038 1038 1039 1039 $defaults = array('child_of' => 0, 'sort_order' => 'ASC', 'sort_column' => 'post_title', 1040 'hierarchical' => 1, 'exclude' => '', 'include' => '', 'meta_key' => '', 'meta_value' => '' );1040 'hierarchical' => 1, 'exclude' => '', 'include' => '', 'meta_key' => '', 'meta_value' => '', 'authors' => ''); 1041 1041 $r = array_merge($defaults, $r); 1042 1042 extract($r); … … 1076 1076 $exclusions .= ')'; 1077 1077 1078 $author_query = ''; 1079 if (!empty($authors)) { 1080 $post_authors = preg_split('/[\s,]+/',$authors); 1081 1082 if ( count($post_authors) ) { 1083 foreach ( $post_authors as $post_author ) { 1084 //Do we have an author id or an author login? 1085 if ( 0 == intval($post_author) ) { 1086 $post_author = get_userdatabylogin($post_author); 1087 if ( empty($post_author) ) 1088 continue; 1089 if ( empty($post_author->ID) ) 1090 continue; 1091 $post_author = $post_author->ID; 1092 } 1093 1094 if ( '' == $author_query ) 1095 $author_query = ' post_author = ' . intval($post_author) . ' '; 1096 else 1097 $author_query .= ' OR post_author = ' . intval($post_author) . ' '; 1098 } 1099 if ( '' != $author_query ) 1100 $author_query = " AND ($author_query)"; 1101 } 1102 } 1103 1078 1104 $query = "SELECT * FROM $wpdb->posts " ; 1079 1105 $query .= ( empty( $meta_key ) ? "" : ", $wpdb->postmeta " ) ; 1080 1106 $query .= " WHERE (post_type = 'page' AND post_status = 'publish') $exclusions $inclusions " ; 1081 1107 $query .= ( empty( $meta_key ) | empty($meta_value) ? "" : " AND ($wpdb->posts.ID = $wpdb->postmeta.post_id AND $wpdb->postmeta.meta_key = '$meta_key' AND $wpdb->postmeta.meta_value = '$meta_value' )" ) ; 1108 $query .= $author_query; 1082 1109 $query .= " ORDER BY " . $sort_column . " " . $sort_order ; 1083 1110
Note: See TracChangeset
for help on using the changeset viewer.