Support

Account

Home Forums Backend Issues (wp-admin) WP 3.9 Validation Failed disables Publish button Reply To: WP 3.9 Validation Failed disables Publish button

  • I’ve noticed the same thing. This is a show-stopper for me, so, for the time being, I’ve put the following workaround in my functions file. It just removes the ‘disabled’ class from the ‘Publish’/’Update’ button as soon as it’s added, which allows you to click it.

    // There is a bug with ACF 4.3.7 and WP 3.9 that disables the 'Save Draft'/'Publish' button if there are validation errors. This is a dirty workaround for that bug: we remove the 'disabled' class from the button every time the button gets clicked (which adds that class to prevent spurious submits).
    
    function load_javascript_on_admin_edit_post_page() {
      global $parent_file;
    
      // If we're on the edit post page.
      if ($parent_file == 'post-new.php' ||
          $parent_file == 'edit.php') {
        echo "
          <script>
          jQuery('#publish').on('click', function() {
            jQuery.this.removeClass('disabled');
          });
          </script>
        ";
      }
    }
    add_action('in_admin_footer', 'load_javascript_on_admin_edit_post_page');