Wordpress Enqueue Scripts Broken

The Problem:
When you export/rebuild function.php after adding a wordpress action “enqueue script”.
The script disappears from function.php

The code that disappears:

wp_deregister_script( 'popper' );
wp_enqueue_script( 'popper', get_template_directory_uri() . '/assets/js/popper.js', false, null, true);

The function.php file would be

  /* Pinegrow generated Enqueue Scripts Begin */

/* Pinegrow generated Enqueue Scripts End */

Code that causes the problem:

<script src="assets/js/popper.js" wp-enqueue-script></script>

If you remove “wp-enqueue-script” it will return back to the function.php file. The problem still exist even if you add “Deregister” or “Register” calls from the action tab or if you even give it a “handle”.

The “Enqueue Admin” action still gets added, seem to be only from the “website” side. That if you set it to 'admin" or “website+admin” from the “locate” drop down.

I was able to reproduce this bug every single time. No matter if it was a brand new project, or if I loaded a fresh copy of the ST2 Theme you provide.

@KodMi thanks for the bug report. We’ll be releasing the fix very soon.

For now, a workaround is to add this attribute to the element that has Enqueue Script action:

wp-enqueue-script-location="_website"
1 Like

Working as expected after the update.

1 Like