Opened 12 years ago
Closed 12 years ago
#25558 closed enhancement (duplicate)
Smarter get_template_part() function
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | |
| Component: | Template | Keywords: | 2nd-opinion has-patch |
| Focuses: | Cc: |
Description
The get_template_part() function could be much smarter if it takes any number or arguments.
function get_template_part() {
$partials = array_filter( func_get_args() );
do_action( "get_template_part_{$slug}", $args[0], $args[1], $args ); // $args[1] for compability
$templates = array();
if ( $partials )
foreach( $partials as $partial ) {
$templates[] = implode( '-', $partials ) . '.php';
array_pop($partials);
}
locate_template($templates, true, false);
}
Attachments (1)
Change History (6)
#1
@
12 years ago
- Milestone Awaiting Review deleted
- Resolution set to duplicate
- Status changed from new to closed
- Version trunk deleted
Note: See
TracTickets for help on using
tickets.
Duplicate of #21676. Also, oddly, your patch looks reversed.