Opened 10 months ago

Last modified 3 months ago

#21276 new defect (bug)

Respect 'suppress_filters' arg in WP_Query->get_posts()

Reported by: brandondove Owned by:
Priority: normal Milestone: Future Release
Component: Query Version: 3.4.1
Severity: normal Keywords: has-patch
Cc: leho@…

Description

Before trying to run filters, there's a check to see if we should suppress filters using the suppress_filters arg. Four filters run whether or not suppress_filters is set to true. This patch just adds checks against that arg for those filter calls.

Attachments (2)

21276.diff (2.1 KB) - added by brandondove 10 months ago.
21276.2.diff (1.8 KB) - added by brandondove 10 months ago.
After scanning through core, 'the_preview' filter is used when previewing a post. I've removed the suppress filters check for that filter.

Download all attachments as: .zip

Change History (8)

  • Version set to 3.4.1
  • Milestone changed from Awaiting Review to 3.5

After scanning through core, 'the_preview' filter is used when previewing a post. I've removed the suppress filters check for that filter.

comment:3 follow-up: ↓ 4   scribu10 months ago

After scanning through core, 'the_preview' filter is used when previewing a post. I've removed the suppress filters check for that filter.

That doesn't sound like a good reason; if Core needs 'the_preview' filter, it shouldn't pass 'suppress_filters' => true, no?

comment:4 in reply to: ↑ 3   brandondove10 months ago

Replying to scribu:

That doesn't sound like a good reason; if Core needs 'the_preview' filter, it shouldn't pass 'suppress_filters' => true, no?

That's why I took that suppress filters check out on that filter. If core needs it, we can't suppress it.

  • Milestone changed from 3.5 to Future Release

From ryan: "Some things in there like split query should run regardless of suppress."

It isn't a huge problem if we don't respect suppress for filters introduced after get_posts() was rewritten to wrap WP_Query in 2.7, as we at least did not change behavior.

Punting for further study.

  • Cc leho@… added
Note: See TracTickets for help on using tickets.