Try using hook on update post meta for post update date.
Something like code below, just change the company_title_meta
and company_role_meta
to your correct meta key.
If something does not work, send a comment and I will try to help you
add_action( 'updated_post_meta', 'on_post_update_after_post_meta', 10, 4 );
function on_post_update_after_post_meta( $meta_id, $post_id, $meta_key, $meta_value )
{
if ( in_array($meta_key, ['company_title_meta','company_role_meta']) ){
$time = time();
$my_post = array(
'ID' => $post_id,
'post_date' => date( 'Y-m-d H:i:s', $time ),
'post_date_gmt' => gmdate( 'Y-m-d H:i:s', $time ),
);
wp_update_post( $my_post );
}
}
Related Posts:
- what is the correct way to compare dates in a WP query_posts meta_query
- don’t publish custom post type post if a meta data field isn’t valid
- Search multiple custom fields by using meta_query
- wordpress plugin error handling
- Redirect after deleting post and keep track of pagination
- Add custom field to media attachment image attribute in post editor
- Custom Post Type with Custom Title
- How can I customize “Pages” admin (edit.php) and “Edit Page” admin (post.php) for bulk edit of custom content type?
- WP Query group/order by category name
- Remove POST_TYPE from custom post type permalink
- Using posts and postmeta table to store custom Address Book Plugin data
- How do I add a custom button to my “edit” list? ( edit.php?post_type= ) beside “Add New”
- how to set default value for checkbox in wordpress
- Community and User Generated Content Website: Have been thinking about Drupal but leaning on WordPress heavily
- Related links – from other sites
- Saving repeated option values in a custom query
- 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 | Fatal Error on register_post_type()
- Assigning the same custom meta box to multiple post types
- Custom Post Type Navigation on Custom Field
- Dynamically add / duplicate custom meta in custom post types
- How to insert content from another Custom Post type into Post?
- Get rewrite slug of custom post type in template
- How to structure a site with product variations pages?
- How to customize a permalink (URL) structure?
- Plugin: register custom post types, child ready and performance best practices
- 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?
- How to Get WordPress custom post data in WooCommerce product meta panel? [closed]
- Cannot save CPT meta box
- custom comments form for custom post type
- don’t publish custom post type post if a meta data field isn’t valid
- Custom fields for custom post type
- Redirect to another page using contact form 7? [closed]
- Custom post type’s extra fields – how to handle?
- custom post data – how to
- Send a conditional email notification when a custom field value changes in Post Type
- How to customize work area / admin area in a custom post type without plugins?
- ACF in wordpress
- How to display custom field value on page?
- How to insert data into meta box from another plugin?
- Display custom post type for specific user
- Custom post type in Custom widget – $listItem
- Generating and downloading files with WP API
- Convert Custom Table Data Based Plugin To Be Searchable
- Need to have an archive widget which organizes and displays a custom post type using a custom date field
- How to hide a custom field from admin?
- How to keep a record of changes to a custom field?
- Fill custom fields when saving custom post types
- Writing a custom Glossary plugin
- Use Gravity Forms and a Shopping Cart for output to Freshbooks for an Estimate [closed]
- Is there a (preferable built-in) way to check what custom queries are used in a theme?
- Mandatory field in Custom post
- How do I ensure that post_type and Taxonomy use the same slug?
- How to store the third party script with HTML code in the wordpress custom input field?
- Custom Form / Search with Custom Post Type Data
- Adding a location field to buddypress activity
- How to upload an image to a custom post type
- wp_set_object_terms creates taxonomies but does not add custom posts to it
- How can i display a taxonomy? i have created a plugin and then a custom type. and a taxonomy , also i have register it
- Unable to gather Image URL from Custom Post Type’s; Custom Meta Field
- custom post type and user post count shortcode
- How can I fetch all the dates from custom fields from various different custom post types and show / list them at one place in ascending order?
- Show Post columns to specific users on condition
- Displaying posts inside table having issues
- Error when moving custom post type to bin
- Automatic Set Category For A Custom Post Type
- How to Disable option of meta field if that option is selected for any other post in custom post type?
- 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 display all custom fields associated with a post type – IN THE ADMIN AREA?
- Registering an optional custom post type from a plugin
- Add category slug as class attribute in a link array
- Add Excerpt On Quicksand Plugin
- Select Menu for Custom post Type does not save
- Multiple Block Quotes without using HTML
- How to apply order on custom taxonomy and custom meta key on custom post type
- How can i display on front page a movie that is atached in a post type
- Set a Custom Post Type as a Homepage
- Exposing custom fields to the user in custom type post
- Creating post custom field text area
- Sort CPT by taxonomy AND THEN by custom field
- How to display *block number* instead *date value* on WordPress posts?
- 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?
- Search everything (posts, pages, tags, cpt, meta)
- front end radio custom taxonomy with custom post type
- How to get source of custom meta image?
- Displaying Meta Box Image
- Custom fields array to display it monthly
- How to show the post which checkbox is not selected
- Meta_query by date for Events archive
- Show Templates in Custom Post Type Editor
- Custom Post Type as invoice or order template
- Make each Value of custom field show related posts when clicked