Skip to content

Commit 79bd0fe

Browse files
committed
fix(wp-the): add missing args array parameters in some Template Hierarchy Everywhere functions
1 parent 79e3f81 commit 79bd0fe

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

includes/vendor/WP_Template_Hierarchy_Everywhere.php

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,8 @@ function template_part_hierarchical($slug, $name = null, $extension_only = false
321321
*
322322
* @uses template_part_hierarchical()
323323
* @uses get_header()
324-
* @param $name
324+
* @param string $name The template name.
325+
* @param array $args Parameters to pass to the template.
325326
*/
326327
function get_header_hierarchical($name = null, $args = [])
327328
{
@@ -336,12 +337,13 @@ function get_header_hierarchical($name = null, $args = [])
336337
*
337338
* @uses template_part_hierarchical()
338339
* @uses get_footer()
339-
* @param $name
340+
* @param string $name The template name.
341+
* @param array $args Parameters to pass to the template.
340342
*/
341-
function get_footer_hierarchical($name = null)
343+
function get_footer_hierarchical($name = null, $args = [])
342344
{
343345
$template = template_part_hierarchical('footer', $name, true);
344-
get_footer($template);
346+
get_footer($template, $args);
345347
}
346348
endif;
347349

@@ -351,12 +353,13 @@ function get_footer_hierarchical($name = null)
351353
*
352354
* @uses template_part_hierarchical()
353355
* @uses get_sidebar()
354-
* @param $name
356+
* @param string $name The template name.
357+
* @param array $args Parameters to pass to the template.
355358
*/
356-
function get_sidebar_hierarchical($name = null)
359+
function get_sidebar_hierarchical($name = null, $args = [])
357360
{
358361
$template = template_part_hierarchical('sidebar', $name, true);
359-
get_sidebar($template);
362+
get_sidebar($template, $args);
360363
}
361364
endif;
362365

@@ -381,9 +384,10 @@ function get_sidebar_hierarchical($name = null)
381384
* @since WP 2.7.0
382385
*
383386
* @param bool $echo Default to echo and not return the form.
387+
* @param array $args Parameters to pass to the searchform.
384388
* @return string|void String when $echo is false.
385389
*/
386-
function get_search_form_hierarchical($echo = true)
390+
function get_search_form_hierarchical($echo = true, $args = [])
387391
{
388392
/**
389393
* 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)
408412
$format = apply_filters('search_form_format', $format);
409413

410414
$search_form_template = template_part_hierarchical('searchform');
415+
if (!empty($args)) {
416+
extract($args);
417+
}
411418
if ('' != $search_form_template) {
412419
ob_start();
413420
require($search_form_template);

0 commit comments

Comments
 (0)