Make WordPress Core

Opened 13 years ago

Closed 12 years ago

#21276 closed defect (bug) (wontfix)

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

Reported by: brandondove's profile 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 13 years ago.
21276.2.diff (1.8 KB) - added by brandondove 13 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
13 years ago

#1 @brandondove
13 years ago

  • Version set to 3.4.1

#2 @scribu
13 years ago

  • Milestone changed from Awaiting Review to 3.5

@brandondove
13 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
13 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
13 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
13 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
12 years ago

  • Cc leho@… added

#7 @wonderboymusic
12 years ago

  • Keywords reporter-feedback close added

Is this still considered an issue?

#8 @brandondove
12 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
12 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.