Opened 6 years ago
Last modified 6 years ago
#51658 assigned enhancement
Themes: Allow template loading functions to filter templates to search for
| Reported by: | amibe | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Themes | Version: | 3.0 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: | template |
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.
6 years ago
#1
- Keywords has-patch added
#2
@
6 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
@
6 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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