Support

Account

Home Forums Gutenberg acf form_gutenberg jquery error

Unread

acf form_gutenberg jquery error

  • Hi,
    I would like to report a possible issue related to ACF5 with Gutenberg.
    Sometimes happens that the browser console report the following error
    $ is not a function
    blocking the execution of the gutenberg editor screen.

    This issue is related to a bit of javascript code that resides in the following acf plugin file

    includes/forms/form_gutenberg.php

    The piece of code is at line 78, within the admin_footer function:

    <script type="text/javascript">
    	$('#normal-sortables').before( $('#acf-form-after-title') );
    </script>

    It would be more safier using the following snippet

    <script type="text/javascript">
    	(function($) {
    		$('#normal-sortables').before( $('#acf-form-after-title') );
    	})(jQuery);
    </script>

    In my case the $ is not a function error will disappear.
    Hope could be useful.

    Thanks in advance.

Viewing 1 post (of 1 total)

The topic ‘acf form_gutenberg jquery error’ is closed to new replies.