Opened 4 years ago
Last modified 4 years ago
#51658 assigned enhancement
Themes: Allow template loading functions to filter templates to search for
Reported by: | amibe | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 3.0 |
Component: | Themes | Keywords: | has-patch |
Focuses: | template | Cc: |
Description
Allow template loading functions to filter templates to search for.
This affects:
get_header()
get_footer()
get_sidebar()
get_template_part()
Note: there's an added check such that if the templates value returned is empty()
the function returns false.
Change History (4)
This ticket was mentioned in PR #670 on WordPress/wordpress-develop by AmibeWebsites.
4 years ago
#1
- Keywords has-patch added
#2
@
4 years ago
Hi there, welcome to WordPress Trac! Thanks for the ticket.
Just noting that this is related to #13239, which was extensively discussed and should also resolve this.
#3
@
4 years ago
Thank you. Admittedly I'm more interested in being able to prevent the header, footer and sidebar templates from being included in certain situations.
The only way I could think of doing this is a filter for $templates
that returns false
.
The PR I've submitted is unrelated to changing the path/location of template files.
Allow template loading functions to filter templates to search for.
This affects:
get_header()
get_footer()
get_sidebar()
get_template_part()
Note: there's an added check such that if the templates value returned is
empty()
the function returns false.Trac ticket: https://core.trac.wordpress.org/ticket/51658