In the save_post
hook, When you are saving your post`s meta, Check initially for the required fields.
If it contains no value, You can straight away redirect user to the admin referrer with an appropriate error message.
You can also go for HTML5 required validation. That will be more efficient.
<input type="text" required>
Related Posts:
- Add validation and error handling when saving custom fields?
- How to store the value of a custom field dropdown select for post referencing?
- Get updated meta data after save_post hook
- Check before publishing, if already exist post with current custom field value
- Check if the value of a field has changed on save_post
- Get updated meta value after post update or published (custom post type) using hook
- custom-meta-box checkboxes from loop won’t save
- Saving Custom Field Data before Publish
- Allow only one post with specific meta value
- Custom metabox not displaying multiselect data in edit mode
- How to validate select field in post meta?
- frontend submit post jQuery clone row won’t save
- Can wp_insert_post_data filter be used to save custom field data?
- Exclude URL’s from sanitize_html_classes
- Use value from ACF to populate other fields
- update a custom field with the value of another existing custom field
- Why WordPress takes time to make request to save post?
- Saving metadata of related post on save_post
- added a meta box to post however when saving menu while debug on throws a warning
- Multiple triggers when publishing, saving or updating a post in WordPress
- Set post status to draft after validating post meta values in save_post hook
- Problem with serialized arrays in custom meta
- explode array within shortcode
- Can I count the number of users matching a value in a multiple value key?
- WP doesn’t show Array Custom Fields?
- How to delete custom field “suggestions” from dropdown list
- How to save custom fields for attachments
- How to get a meta value from all post
- Adding existing user custom field value to a woocommerce product [closed]
- How to save values of a custom input field on the Network > Site Info screen
- How to load php file for specific page in admin?
- How to set default metaboxes on user creation?
- Exclude custom post type from search by custom field value?
- ajax jquery update custom field meta value front end
- Add input field to ‘Pages > Edit Page’ through functions.php
- get_post_meta not working inside loop
- Support auto-save and revisions for custom fields
- How do I exclude posts by custom field value?
- Upcoming Event: How do I sort database by custom date field, but ignore past dates?
- Auto populate a meta box field from another meta box field when publish or save
- Eliminating the appearance of a specific custom field in a post
- Conditional custom field query
- Display two custom values from a post
- Find page IDs with specific meta tag key value pairs
- Order query by meta_value with multiple custom fields
- Display only past events on that page using Visual Composer Grid Bulider
- Accessing loop functions (e.g the_title or the_content) from post ID
- custom avatar removal
- Send email with custom fields after new draft is saved or new post published
- Get posts with same meta value as current post
- Add custom field to all posts in specific post_type
- query posts custom field calculation value
- Get Data From wp_sitemeta for Multisite network
- Syntax Issue: How Do I Call A Custom Field Inside a ForEach Statement? [closed]
- Singleton Custom Field (Meta Box)
- Querying posts by latitude and longitude to build a Google Maps with several markers
- How to display childrens custom fields?
- Attach images to posts using custom fields (just paths to images already uploaded)
- how to display custom fields of post on a web page
- How to fill custom fields with brackets in their key with add_post_meta()?
- How to use pre_get_posts to alter posts_per_page of category pages, where ‘posts_per_page’ will be dynamic
- Front-End User Profile
- Displaying pages with a specific custom meta
- How to update user profile custom fields
- How to validation for sanitize_URL?
- How can I output the custom fields wrapping with HTML
- put saved metabox values back into fields and then display on the front end
- How to get custom image field of specific post id
- Custom field to array?
- wp_get_attachment_image_src() with advanced custom fields returning empty
- How to update custom field of a posts in a particular category
- How to query posts by month based on date custom field?
- Change word in woocommerce product category custom field
- get posts based on non-single metadata
- Problem with revisions only returning four results
- Woocommerce products search with custom fields
- Convert author metadata to a custom field
- Add forms dynamically in admin pages?
- Custom pages or Custom Posts
- get_avatar filter is not working as per requirement
- What WordPress “technology” would I use if I wanted subscribers to be able to mark pages with characteristics and notes?
- WordPress Admin – Automatically Sort Custom Posts by Custom Field Date Value in d-m-Y Fomat
- how can i show WordPress custom field data to my short code?
- how to execute custom field for structured data?
- searching by keywords in post’s metas or pagination links problem
- Permanently show Custom Fields in Editor
- open modal window
- select user with all meta field and field value. I am use Below Query for this ,So any of know another way to fast query instead of below query?
- Retrieve Google API JSON data and store as WordPress Custom Fields
- update meta field value after
- meta_query ‘compare’ => ‘!=’ not working
- If metabox fields has content display content
- Show comon custom field results?
- Display Data From This Custom Media Upload Meta Box?
- Custom fields and auto save
- Display Child Page with custom fields within Parent Page
- Load code for custom fields only on admin pages?
- Pagination not displaying correct number of pages
- Show/Hide Featured Image or replace it with custom field [closed]
- Archive for custom fields?