Ticket #1486: 1486.diff
File 1486.diff, 2.4 KB (added by , 18 years ago) |
---|
-
wp-includes/post-template.php
265 265 parse_str($args, $r); 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 271 271 $output = ''; -
wp-includes/post.php
1037 1037 parse_str($args, $r); 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); 1043 1043 … … 1075 1075 if (!empty($exclusions)) 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_profile('ID',$post_author); 1087 } 1088 if (! (0 == intval($post_author))) { 1089 if ('' == $author_query) { 1090 $author_query = ' post_author = ' . intval($post_author) . ' '; 1091 } else { 1092 $author_query .= ' OR post_author = ' . intval($post_author) . ' '; 1093 } 1094 } 1095 } 1096 if (!('' == $author_query)) 1097 $author_query = " AND ($author_query)"; 1098 } 1099 } 1100 1078 1101 $query = "SELECT * FROM $wpdb->posts " ; 1079 1102 $query .= ( empty( $meta_key ) ? "" : ", $wpdb->postmeta " ) ; 1080 1103 $query .= " WHERE (post_type = 'page' AND post_status = 'publish') $exclusions $inclusions " ; 1081 1104 $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' )" ) ; 1105 $query .= $author_query; 1082 1106 $query .= " ORDER BY " . $sort_column . " " . $sort_order ; 1083 1107 1084 1108 $pages = $wpdb->get_results($query);