Opened 14 years ago
Closed 14 years ago
#17788 closed enhancement (duplicate)
get_query_template() global filter
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.2 |
Component: | Template | Keywords: | has-patch |
Focuses: | Cc: |
Description (last modified by )
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
Thanks.
Attachments (1)
Change History (4)
#2
@
14 years ago
- Keywords has-patch added
Note this section of the coding standards:
http://codex.wordpress.org/WordPress_Coding_Standards#Clever_Code
Could you describe why your approach is better?
#3
@
14 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 );
vs.
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.
The improvement.