@@ -321,7 +321,8 @@ function template_part_hierarchical($slug, $name = null, $extension_only = false
321
321
*
322
322
* @uses template_part_hierarchical()
323
323
* @uses get_header()
324
- * @param $name
324
+ * @param string $name The template name.
325
+ * @param array $args Parameters to pass to the template.
325
326
*/
326
327
function get_header_hierarchical ($ name = null , $ args = [])
327
328
{
@@ -336,12 +337,13 @@ function get_header_hierarchical($name = null, $args = [])
336
337
*
337
338
* @uses template_part_hierarchical()
338
339
* @uses get_footer()
339
- * @param $name
340
+ * @param string $name The template name.
341
+ * @param array $args Parameters to pass to the template.
340
342
*/
341
- function get_footer_hierarchical ($ name = null )
343
+ function get_footer_hierarchical ($ name = null , $ args = [] )
342
344
{
343
345
$ template = template_part_hierarchical ('footer ' , $ name , true );
344
- get_footer ($ template );
346
+ get_footer ($ template, $ args );
345
347
}
346
348
endif ;
347
349
@@ -351,12 +353,13 @@ function get_footer_hierarchical($name = null)
351
353
*
352
354
* @uses template_part_hierarchical()
353
355
* @uses get_sidebar()
354
- * @param $name
356
+ * @param string $name The template name.
357
+ * @param array $args Parameters to pass to the template.
355
358
*/
356
- function get_sidebar_hierarchical ($ name = null )
359
+ function get_sidebar_hierarchical ($ name = null , $ args = [] )
357
360
{
358
361
$ template = template_part_hierarchical ('sidebar ' , $ name , true );
359
- get_sidebar ($ template );
362
+ get_sidebar ($ template, $ args );
360
363
}
361
364
endif ;
362
365
@@ -381,9 +384,10 @@ function get_sidebar_hierarchical($name = null)
381
384
* @since WP 2.7.0
382
385
*
383
386
* @param bool $echo Default to echo and not return the form.
387
+ * @param array $args Parameters to pass to the searchform.
384
388
* @return string|void String when $echo is false.
385
389
*/
386
- function get_search_form_hierarchical ($ echo = true )
390
+ function get_search_form_hierarchical ($ echo = true , $ args = [] )
387
391
{
388
392
/**
389
393
* Fires before the search form is retrieved, at the start of get_search_form_hierarchical().
@@ -408,6 +412,9 @@ function get_search_form_hierarchical($echo = true)
408
412
$ format = apply_filters ('search_form_format ' , $ format );
409
413
410
414
$ search_form_template = template_part_hierarchical ('searchform ' );
415
+ if (!empty ($ args )) {
416
+ extract ($ args );
417
+ }
411
418
if ('' != $ search_form_template ) {
412
419
ob_start ();
413
420
require ($ search_form_template );
0 commit comments