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)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.