Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#20049 closed defect (bug) (fixed)

WP_Query should use WP_Query::is_admin, not is_admin(), to add protected statuses

Reported by: nacin Owned by: nacin
Priority: normal Milestone: 3.4
Component: Query Version:
Severity: normal Keywords:
Cc: Focuses:

Description

WP_Query sets up an WP_Query::is_admin flag based on is_admin() in WP_Query::parse_query(). But it never uses it. When it goes to add protected post statuses, it checks is_admin() again.

To allow this to be easily filtered from the parse_query hook (something I plan to submit to the Debug Bar Console, as it uses admin-ajax which thinks it is is_admin), we should be using the query flag, not the function.

Attachments (1)

20049.diff (549 bytes ) - added by nacin 15 years ago.

Download all attachments as: .zip

Change History (3)

@nacin
15 years ago

#1 @ryan
15 years ago

Looks good.

#2 @nacin
15 years ago

  • Owner set to nacin
  • Resolutionfixed
  • Status newclosed

In [19932]:

Use is_admin WP_Query propery, not is_admin(), when adding protected post statuses to the query. Allows for overriding on the parse_query hook. fixes #20049.

Note: See TracTickets for help on using tickets.