Opened 21 months ago
Last modified 21 months ago
#18480 new enhancement
get_sidebar should be able to accept an array of names as parameter.
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Template | Version: | 3.2.1 |
| Severity: | normal | Keywords: | has-patch 2nd-opinion |
| Cc: |
Description
get_sidebar uses load_template to do the work of template loading.
load_template will accept an array of template names for loading.
load_template will then load the first existing template from that array.
Seems like get_sidebar should also accept an array of names that can be searched in declining order.
This would allow a theme to specify a first choice, second choice, etc. for the sidebar.
Attachments (2)
Change History (5)
- Keywords 2nd-opinion added; get_sidebar theme removed
The fact that load_template() accepts an array is not a good reason for changing get_sidebar().
Related: #18331
I totally agree that just because load_template() accepts an array is not sufficient justification.
In a theme I am developing I ran ran into a situation where I needed the functionality.
I'm definitely not trolling the codex looking for things to change. This came about as one possible answer for a theme situation.
But, I see that other -- wider sweeping -- changes are afoot in #18331. Thanks for the info.
PS: I was using http://funcdoc.wordpress.com/2008/01/21/how-to-patch-the-wordpress-core/
I appreciate your more up-to-date link.

Patch to general-template.php modify get_sidebar to accept array as parameter