Ticket #1486: 1486.patch
File 1486.patch, 1.4 KB (added by , 19 years ago) |
---|
-
template-functions-post.php
300 300 if ( !isset($r['sort_order']) ) 301 301 $r['sort_order'] = 'ASC'; 302 302 303 $authors = ''; 304 if (!empty($r['authors'])) { 305 $auths = preg_split('/[\s,]+/',$r['authors']); 306 if (count($auths)) { 307 foreach ($auths as $auth) { 308 if ( (is_string($auth)) && (! is_int($auth)) ) { 309 $author_ID = $wpdb->get_var("SELECT ID from $wpdb->users WHERE user_login = '$auth'"); 310 if (! $author_ID) next; 311 $auth = $author_ID; 312 } 313 if ('' == $authors) { 314 $authors .= ' post_author = ' . intval($auth) . ' '; 315 } else { 316 $authors .= ' OR post_author = ' . intval($auth) . ' '; 317 } 318 } 319 $authors = " AND ($authors) "; 320 } 321 } 322 303 323 $exclusions = ''; 304 324 if ( !empty($r['exclude']) ) { 305 325 $expages = preg_split('/[\s,]+/',$r['exclude']); … … 313 333 $pages = $wpdb->get_results("SELECT * " . 314 334 "FROM $wpdb->posts " . 315 335 "WHERE post_status = 'static' " . 336 "$authors " . 316 337 "$exclusions " . 317 338 "ORDER BY " . $r['sort_column'] . " " . $r['sort_order']); 318 339 … … 341 362 $r['title_li'] = __('Pages'); 342 363 if ( !isset($r['echo']) ) 343 364 $r['echo'] = 1; 365 if ( !isset($r['authors']) ) 366 $r['authors'] = ''; 344 367 345 368 $output = ''; 346 369