• Resolved James Morton

    (@stylishjm)


    Hello

    Excellent plugin, works flawlessly with ACF5 on the front end forms, however there is a big issue where trying to publish posts from the back end causes the publish button to stop functioning and it just endlessly shows the loading animation on the button.

    On my site, the front end form posts to a custom post type (which requires the recaptcha) and saves it as “pending”. From there I can do a review and publish, however I cannot go past that. I’ve disabled the plugin and it works fine, however I really need this to work to stop spammers from filling in the form.

    Please advise.

    James

    https://www.ads-software.com/plugins/advanced-custom-fields-recaptcha-field/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter James Morton

    (@stylishjm)

    I can see the error message in the console “Uncaught ReferenceError: grecaptcha is not defined” which I am sure is related.

    Thread Starter James Morton

    (@stylishjm)

    Found a fix for my specific setup.

    from line 147, change to this

    function input_admin_enqueue_scripts() {
    
    		$dir = plugin_dir_url( __FILE__ );
    
    		if (!is_edit_page()) {
    			wp_enqueue_script('recaptcha-api', 'https://www.google.com/recaptcha/api.js');
    			wp_register_script( 'acf-input-recaptcha', "{$dir}js/input.js" );
    			wp_enqueue_script('acf-input-recaptcha');
    		};
    	}

    and on line 213, change to this

    // create field
    if (!is_edit_page()) {
    	new acf_field_recaptcha();
    }

    Page publishes fine now.

    Plugin Author Irvin Lim

    (@irvinlim)

    Apologies for the late reply.

    Glad to know that you have resolved your issue. I had issued a fix a while back but it seemed that WordPress didn’t update the version number. You may want to try backing up your current version of the file and see if my fix works for you.

    Thank you for your support!

    Thread Starter James Morton

    (@stylishjm)

    Hello

    Just tested the update and works great now! Many thanks

    James

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Post not publishing’ is closed to new replies.