You would use “save_post” hook. It will look something like this.
add_action( 'save_post', 'populate_empty_place' );
function populate_empty_place( $post_id ) {
//verify post is not a revision
if ( !wp_is_post_revision( $post_id ) && get_post_type($post_id) == 'report') {
// Check for empty place
// And popluate with your own value
}
}
Related Posts:
- wordpress plugin error handling
- WP Query group/order by category name
- Using posts and postmeta table to store custom Address Book Plugin data
- how to set default value for checkbox in wordpress
- How to have the right design for a custom post type without accessing themes
- handling csv data with a custom post type
- Customize permalink when creating a post
- Custom Post Type Navigation on Custom Field
- Give a permalink to Custom Post Types without title
- Orderby CPT custom fields not working
- How to use TinyMCE Editor for one of my custom post meta field?
- How to Create a WordPress Plugin With Custom Post Type/Custom Field Features?
- custom comments form for custom post type
- Custom fields for custom post type
- Custom post type’s extra fields – how to handle?
- Send a conditional email notification when a custom field value changes in Post Type
- ACF in wordpress
- Custom post type in Custom widget – $listItem
- Generating and downloading files with WP API
- Writing a custom Glossary plugin
- Mandatory field in Custom post
- How to store the third party script with HTML code in the wordpress custom input field?
- Auto update publish date of CPT Post if default post custom field value match to cpt post CF Value
- How to upload an image to a custom post type
- Unable to gather Image URL from Custom Post Type’s; Custom Meta Field
- Show Post columns to specific users on condition
- Error when moving custom post type to bin
- Run query on specific admin options page and send results to select field in another function
- Custom post type that lets users create a set of posts?
- Error in WP Query. If variable is empty it is displaying previous post value
- How to consume external API from WordPress post editor and display the response data in the custom field?
- How do I set the default admin sort order for a custom post type to a custom column?
- Quick edit screen customization
- Development of a WordPress Search Plugin – Best Practices
- Mini-Site Strategy
- WordPress 4.4+ : How to revision CPT + metadata
- WP_Query orderby custom field then post_date in one query
- Using Custom Fields in Custom Post Type URL
- Query custom post type by custom field
- Adding meta values to permalink
- Detect meta value changes when post is updated (post_updated)
- Search everything (posts, pages, tags, cpt, meta)
- front end radio custom taxonomy with custom post type
- How to get source of custom meta image?
- Get post info inside modal window?
- Add Taxonomy Values Within a Custom Post Type RSS Feed
- Displaying Meta Box Image
- Custom field default value with counter
- How could I create a ‘private comments’ section on a custom post type?
- Check if a specific custom field exists?
- WordPress Create Post from front-end
- Issue with pre_get_posts on custom post type archive pages
- Display custom fields on post excerpt or teaser
- Calculate all custom field values in the post loop
- add custom field to custom post type
- Display custom fields from custom posts in RSS feed
- A better way to add a meta box to custom post types
- Rows with custom columns not well formatted after Quick Edit save
- How do I set all of a particular post meta to a value within the custom post type I’m in?
- Can we create a custom post template for a specific page template
- Settings API – save multiple tabs at once
- wordpress remove views from action links in a custom post
- Add post meta programmatically to attachment
- How to create multiple editor?
- Display post from a date range from custom field
- Get Specific Template Part if Custom Field is Some Value
- Targeting categories in custom fields
- How to make a pulldown menu display custom meta terms in a theme?
- Amazon.com intergration with WordPress?
- Add post type pages with plugin
- Make a custom column sortable by a value from a different custom post type
- How to List Custom Post Type Titles Based on Theirs Taxonomy Terms Inside a Nested Loop
- Most viewed post of custom post type
- Making a form for user to add new custom post with custom taxonomies and custom fields
- Update value inside array update_post_meta
- WP query_posts group by meta field related
- Filter custom post type admin list by custom meta column, where the column is another custom posts meta value
- when looping through custom post data not appearing
- Where is get_post_meta value located?
- Confused about where to store my data
- Sort loop by custom field from different post type
- Meta_query by date for Events archive
- How to reset HTML filter input fields on CPT list page?
- WordPress loop, show only one post per custom field
- get_post_types doesn’t work in plugin
- Show Templates in Custom Post Type Editor
- Render custom taxonomy query as single template
- How to avoid hardcoded text in a custom page template?
- Is it possible to make one of two custom fields in Custom Post Type UI Required but not the other?
- Custom Post Type as invoice or order template
- How to use get_sidebar in plugin folder?
- Make each Value of custom field show related posts when clicked
- Filter CPT based on meta box value using Flexible Posts widget?
- Querying meta values within an array
- Filter Custom post type by another Custom post type
- How to create an upload page (front side)
- Retrieve a post with its ACF repeater fields in wordpress
- How to change post cpt with submit button?
- Custom Post Type featured option
- WP Query + custom fields: How to query event posts from the current date backwards 6 months and organize it month by month?