WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 2 years ago

#13278 closed enhancement (duplicate)

query.php, exclude posts by more authors bug

Reported by: aesqe Owned by: ryan
Milestone: Priority: normal
Severity: normal Version:
Component: Query Keywords:
Focuses: Cc:

Description

in latest nightly on lines 2053 - 2054:

$q['author'] = explode('-', $q['author']);
$q['author'] = (string)absint($q['author'][1]);

just removing 'absint' from line 2054 would enable queries like this following one to give expected results (posts where author ids are not 1 or 2):

`query_posts('author=-1,2')`

replacing both lines with something like this:

$q['author'] = str_replace('-', '', $q['author']);

would also allow this input:

`query_posts('author=-1,-2')`

currently, these queries just exclude the author whose ID is first in list.

Change History (3)

comment:1 nacin4 years ago

  • Milestone changed from 3.0 to 3.1

comment:2 nacin3 years ago

  • Milestone changed from Awaiting Triage to Future Release
  • Type changed from defect (bug) to enhancement

comment:3 SergeyBiryukov2 years ago

  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from new to closed

#16854 has a patch.

Note: See TracTickets for help on using tickets.