Skip to content

Commit

Permalink
Added arguments to functions
Browse files Browse the repository at this point in the history
Added functionality to get custom headers, footers and sidebars.
  • Loading branch information
dmtrpro committed Oct 9, 2017
1 parent 4bd4d4f commit 5850e2d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Twig/Extension/ThemeExtension.php
Expand Up @@ -45,9 +45,9 @@ public function getFunctions()
/**
* Displays Wordpress theme header (and administration menu bar if available).
*/
public function getHeader()
public function getHeader($name = null)
{
\get_header();
\get_header($name);

\_wp_admin_bar_init();
\wp_admin_bar_render();
Expand All @@ -56,17 +56,17 @@ public function getHeader()
/**
* Displays Wordpress theme sidebar.
*/
public function getSidebar()
public function getSidebar($name = null)
{
\get_sidebar();
\get_sidebar($name);
}

/**
* Displays Wordpress theme footer.
*/
public function getFooter()
public function getFooter($name = null)
{
\get_footer();
\get_footer($name);
}

/**
Expand Down

0 comments on commit 5850e2d

Please sign in to comment.