WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 7 years ago

#21276 closed defect (bug) (wontfix)

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

Reported by: brandondove Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.4.1
Component: Query Keywords: has-patch
Focuses: Cc:

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 8 years ago.
21276.2.diff (1.8 KB) - added by brandondove 8 years 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 (11)

@brandondove
8 years ago

#1 @brandondove
8 years ago

  • Version set to 3.4.1

#2 @scribu
8 years ago

  • Milestone changed from Awaiting Review to 3.5

@brandondove
8 years ago

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

#3 follow-up: @scribu
8 years 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?

#4 in reply to: ↑ 3 @brandondove
8 years 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.

#5 @nacin
8 years ago

  • 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.

#6 @lkraav
8 years ago

  • Cc leho@… added

#7 @wonderboymusic
7 years ago

  • Keywords reporter-feedback close added

Is this still considered an issue?

#8 @brandondove
7 years ago

The issue still exists in core, but per Nacin's feedback, it seems like this isn't something that needs to be solved.

#9 @SergeyBiryukov
7 years ago

  • Keywords reporter-feedback close removed
  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.