Skip to content

Commit

Permalink
refactor: method set as static
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaPipolo authored and juanlopez4691 committed Mar 27, 2024
1 parent 68dc7c9 commit b3e0267
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/class-timber.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function get_menus( array $context ): array {
#[Filter( 'timber/twig' )]
public function extend_timber_functions( TwigEnvironment $twig ): TwigEnvironment {
$twig->addFunction(
new TwigFunction( 'enqueue_script', __CLASS__ . '::enqueue_script' )
new TwigFunction( 'enqueue_script', array( $this, 'enqueue_script' ) )
);

$twig->addFunction(
Expand All @@ -111,7 +111,7 @@ public function extend_timber_functions( TwigEnvironment $twig ): TwigEnvironmen
*
* @param string $handle The script handle.
*/
public static function enqueue_script( string $handle ): void {
public function enqueue_script( string $handle ): void {
wp_enqueue_script( $handle );
}

Expand Down

0 comments on commit b3e0267

Please sign in to comment.