Wordpress - Prevent Post Submission unless valid data -


I am creating a custom wordpress theme when the user is trying to update the custom post type (product) I want to fulfill certain assumptions before saving / uploading them.

What's going on here.

I have a series of "things" IMG and every "thing" for the text has an advanced custom field.

So my goal is here, if they upload an image, but do not fill the text box, then do not allow them to save / upload the post. It also works in reverse (if they provide text but no image).

So now there is a hook in 'save_post' which verifies and sets a notice at the top of the screen so that they know what they did wrong though, it does not really work because 'save_post' Is called after posting. Even if it was not, then I still have no way to stop the post from saving in any way.

So, how do I complete this task?

I think you can do this by filtering it with content_save_pre .


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -