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');
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.