Hi people,
I want to ignore required fields only if I’m saving a draft (click #save-post => click_ignore).
All the others POST STATUS (pending, publish, future_publish, CUSTOM_POST_STATUS) need to validate all required fields.
How I can do it?
Now i solved editing the function click_ignore like that
click_ignore: function( e ) {
if(jQuery('#post_status').val()=='pending'){
this.$trigger = e.$el;
} else {
// reference
var self = this;
// vars
this.ignore = 1;
this.$trigger = e.$el;
this.$form = e.$el.closest('form');
// remove error message
$('.'+this.message_class).each(function(){
acf.remove_el( $(this) );
});
// ignore required inputs
this.ignore_required_inputs();
// maybe show errors
setTimeout(function(){
self.ignore = 0;
}, 100);
}
}