So here’s what I ended up doing: I hide the publish button, replace it with my own publish button (one that does not submit the form) and when you click that button the validation script is executed. When there are no errors, a click event is registered on the original publish button. That way, no more drafts and problem solved.
Related Posts:
- Validating Custom Meta Box Values & Required Fields
- Add a Jquery Datepicker to custom field in post edit
- Arrange custom fields with drag and drop?
- Convert jQuery Datepicker Format to SQL Date Format
- Correct Approach for Validating Custom Field Input
- How to make custom comment fields required and message field not required
- How to reload the role specific registration form on validation errors?
- ajax jquery update custom field meta value front end
- sort search results by custom fields using dropdown
- How to validate custom field on lost password form before the user id field?
- Validate data on attachment_fields_to_save
- jQuery – Automatic event trigger does not **really** check my form
- Adding auto-complete to custom gravity field not working
- How to populate custom field dropdown box based on prior selection?
- Uploading PDF using Media Uploader
- Show user info in a hovercard [closed]
- Warn user that data may be lost for custom pages
- How to use media upload on metabox post page without breaking TinyMCE?
- How to add fields in custom registration form, validate it and aave to db? [closed]
- WordPress colorpicker save both hex and RGB
- How to validation for sanitize_URL?
- How do I convert all custom_field php timestamps in the database to js timestamps?
- Jquery on custom-field backend
- Trying to implement AJAX into my admin pages. Am I improperly enqueue and localizing my scripts?
- Meta field bulk editing no longer working in WP 6.0 [closed]
- Making custom meta box required (with error message if not filled in) on Gutenberg
- How to save multiple custom user profile fields using repeater JQuery
- How to format the various types of custom fields?
- Get custom fields when hover link of post
- CSS conditional on custom field value
- show custom field content in jquery tabs
- Set post status to draft after validating post meta values in save_post hook
- WP_Query – Order results by meta value
- Custom query with orderby meta_value of custom field
- Orderby meta_value only returns posts that have existing meta_key
- How to enable revisions for post meta data?
- Can I query custom meta data through WP_Query
- Including custom fields in search?
- Change behavior of “Insert into Post” based on attachment metadata
- Sort posts by custom field numeric value using dropdown
- How to position a custom field before the editor
- How can I display all values of a custom field from posts with a certain value of another custom field or from certain post types?
- Is there a way to do multiple ordering on a multiple meta_query?
- searching in custom meta field
- How to add upload field in a custom taxonomy?
- Display thumbnail from custom field
- Bulk move (or copy) from a custom field to the post content?
- Getting Custom Field data from a page hierarchy
- Custom contact form 7 select with custom values [closed]
- limit amount of photos uploaded per cpt post
- Problem with adding exta field in metabox in custom post type
- Setting orderby to a custom field using pre_get_posts
- Add WYSIWYG to Image Description field
- Calling custom profile fields?
- How to Display Custom Meta Box only on Specific Page IDs
- Get custom field label
- Show ACF fields only on certain page in the backend
- Create Multiple File Upload Metabox in WordPress
- WP_User_Query pulling ACF to loop
- how to put a custom field value in variable
- Custom Metabox Not Saving
- How to add the image URL from an external RSS feed and insert into a custom field?
- My custom backend codes shows up when i try to view my website
- Advanced Custom Fields dynamic update_field
- Custom Profile Fields move from BBpress to BuddyPress
- How can I output a list of values for a custom field, and posts with those values?
- Manipulate javascript code from custom made admin page menu
- Add additional ‘description’ field for defined roles / role metadata?
- Change the main loop WordPress impact on the server?
- Avoiding ACF get_field and returning to core WordPress function
- Walker class for sub-menu with ACF fields
- Display custom field value part by part?
- Add custom fields to existing posts (admin pages)
- How do i get the attached images with custom value checked?
- How to disable Edit Post and Allow only Custom Field?
- Convert attachment ID into url?
- Cannot save underscore custom fields in one wordpress installation using xmlrpc and underscores
- Diamond question mark in text after migrating content
- Custom Fields Question
- do_shortcode close
- Displaying information from custom field on custom post type
- Display custom field value as a mailto: link
- Make separate text boxes for separate WordPress Custom Fields
- Sort by an ACF field in a tax_query
- Custom field metabox not showing in back-end
- Load one page with parent and child pages
- Why can’t I get the correct post permalink
- Use a different catalog image than the featured image
- Ordering posts by custom fields
- How to diplay a div only if at least one author custom profile field is filled?
- Set custom field value when reaching expiration date
- Include custom fields into the content of a regular page
- Bypassing a Form Options
- How to query posts that have certain post meta keys, and sort by meta key and/or value
- How to implement jquery-ui autocomplete into custom fields?
- Add image custom attribute [closed]
- Foreach giving one too many list items, how can I remove the last empty line?
- Add custom fields to specific menus
- Truncating characters in Advanced Custom Fields works some places but not others?
- How to add an ACF only for parent term?