Support

Account

Home Forums ACF PRO Is it possible to apply validation to draft post? Reply To: Is it possible to apply validation to draft post?

  • Hi @razz
    Not sure, if this is still a concern, but here is what worked for me.
    Just removing event listener that caused ignoring of validation.
    Put this in your JS

    
    acf.addAction('prepare', function(){
        acf.validation.removeEvents({
            'click #save-post': 'onClickSave',
        });
    });
    

    or if you don’t know how or where, add this to your functions.php

    
    add_action('acf/input/admin_footer', function(){
        ?>
        <script>
            acf.addAction('prepare', function(){
                acf.validation.removeEvents({
                    'click #save-post': 'onClickSave',
                });
            });
        </script>
        <?php
    }, 10);