Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#17788 closed enhancement (duplicate)

get_query_template() global filter

Reported by: 5ubliminal Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.2
Component: Template Keywords: has-patch
Focuses: Cc:

Description (last modified by scribu)

My implementation has two parameters ($type also):

is_array( $new_templates = apply_filters( "query_template", $templates, $type ) ) and
	!empty( $new_templates ) and ( $templates = $new_templates );

Plus it validates the result. If it's not an array it reverts to original.

I'd say a bit better than the 11 MONTHS (OMG): #14310


Attachments (1)

get_query_template-filter.patch (705 bytes) - added by 5ubliminal 4 years ago.
The improvement.

Download all attachments as: .zip

Change History (4)

4 years ago

The improvement.

#1 @scribu
4 years ago

  • Description modified (diff)

#2 @scribu
4 years ago

  • Keywords has-patch added

Note this section of the coding standards:


Could you describe why your approach is better?

#3 @scribu
4 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

I mean, it boils down to this:

apply_filters( "{$type}_template_hierarchy", $templates );


apply_filters( "template_hierarchy", $templates, $type );

Since it addresses the same problem, I'm going to close it as a duplicate (should have been more explicit when I suggested you look at the other ticket).

Feel free to comment either here or on the other ticket.

Note: See TracTickets for help on using tickets.