Opened 10 months ago
Last modified 3 months ago
#21276 new defect (bug)
Respect 'suppress_filters' arg in WP_Query->get_posts()
| Reported by: |
|
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)
Change History (8)
brandondove — 10 months ago
comment:1
brandondove — 10 months ago
- Version set to 3.4.1
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.
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
brandondove — 10 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.

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