Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added arguments to functions #136

Merged
merged 3 commits into from Nov 6, 2017
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 15 additions & 6 deletions Twig/Extension/ThemeExtension.php
Expand Up @@ -44,33 +44,42 @@ public function getFunctions()

/**
* Displays Wordpress theme header (and administration menu bar if available).
*
* @param string|null $name
*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, could you also update PHPdoc on methods your updated please? Just to add the new argument:

      * @param string|null $name

public function getHeader()
public function getHeader($name = null)
{
\get_header();
\get_header($name);

\_wp_admin_bar_init();
\wp_admin_bar_render();
}

/**
* Displays Wordpress theme sidebar.
*
* @param string|null $name
*/
public function getSidebar()
public function getSidebar($name = null)
{
\get_sidebar();
\get_sidebar($name);
}

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

/**
* Displays a Wordpress theme template part.
*
* @param string $name
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be $slug here please ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow! Sorry) This was a 2 a.m. when I write this)

* @param string|null $name
*/
public function getTemplatePart($slug, $name = null)
{
Expand Down