Skip to content

Commit

Permalink
✨ Support passing an array to enqueueJs() (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
ouun authored and QWp6t committed Nov 27, 2023
1 parent 7cf04c6 commit 0a97cdf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Roots/Acorn/Assets/Concerns/Enqueuable.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ public function enqueueCss(string $media = 'all', array $dependencies = [])
* @param array $dependencies
* @return $this
*/
public function enqueueJs(bool $in_footer = true, array $dependencies = [])
public function enqueueJs(bool|array $args = true, array $dependencies = [])
{
$this->js(function ($handle, $src, $bundle_dependencies) use (&$dependencies, $in_footer) {
$this->js(function ($handle, $src, $bundle_dependencies) use (&$dependencies, $args) {
$this->mergeDependencies($dependencies, $bundle_dependencies);

wp_enqueue_script($handle, $src, $dependencies, null, $in_footer);
wp_enqueue_script($handle, $src, $dependencies, null, $args);

$this->inlineRuntime();

Expand Down

0 comments on commit 0a97cdf

Please sign in to comment.