Skip to content

Commit

Permalink
PLANET-7625: Move scripts from twig templates
Browse files Browse the repository at this point in the history
- Fix php lint issues
  • Loading branch information
mardelnet committed Jan 17, 2025
1 parent b01174e commit 9a4eab7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion page.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@
do_action('pass_gtm_data', $context);
Timber::render('single-page.twig', $context);
} else {

do_action('pass_gtm_data', $context);
Timber::render([ 'page-' . $post->post_name . '.twig', 'page.twig' ], $context);
}
4 changes: 2 additions & 2 deletions src/TwigScriptsEnqueuer.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ private function get_file_version(string $relative_path): ?string
/**
* Pass data to the GRT script from the Timber context.
*
* @param Object $context The Timber context.
* @param array $context The Timber context.
*/
public function pass_google_tag_manager_data($context)
public function pass_google_tag_manager_data(array $context): void
{
$script = [
'action_name' => 'enqueue_google_tag_manager_script',
Expand Down

0 comments on commit 9a4eab7

Please sign in to comment.