I think I found the solution:
add_filter('wp_insert_post_data','reset_post_date',99,2);
function reset_post_date($data,$postarr) {
//update post time on status change
$data['post_date'] = $data['post_modified'];
$data['post_date_gmt'] = $data['post_modified_gmt'];
//also update title and add the current date to title
$data['post_title'] = 'Your Default Title - '. current_time ( 'm-d-Y' );
//also update the slug of the post for the URL
$data['post_name'] = wp_unique_post_slug( sanitize_title( $data['post_title'] ), $postarr['ID'], $data['post_status'], $data['post_type'], $data['post_parent'] );
return $data;
}
Related Posts:
- Replace image name on upload to the new post name on front-end form
- Edit the post title from the frontend
- Change modified date to current date when title updated automatically
- how to show current date on post title which should be auto update in every day
- How to change the case of all post titles to “Title Case”
- How to get posts published between a date and today?
- Where is the old post permalink slug stored?
- Apply the_title() filter in post & page title, but not in menu title
- How to get post creation date?
- Changing the post date and time with function
- Use category base slug in posts’ permalink
- Custom Post Types, slug, archive and SEO plugins
- Remove post title input from edit page
- Is it possible to Schedule Attachments in WordPress?
- How to automatically generate a unique random slug
- using wp_update_post on save_post
- Post slugs and images cannot have same name?
- Set Post Title to Read-only and Disable Permalink Slug Editor in Gutenberg
- Change the Slug of Post Type post to baseurl/post/%postname%
- Disallow Same Post Title
- Get title of post without using the_title();
- Verify if tag is used on posts
- How to put last edited entry on top of the blog-post list?
- Query posts from current year
- Dynamically update post title in admin page
- How to control which category will be picked for the slug of a post?
- Change slug with custom field
- Determining Slug Before and After Edit
- Update existing post dates to random dates
- How to show posts rank based on custom field value
- featuring old articles without messing up with the archive
- How to update all post at once?
- How to display an icon when a new post is published and then remove it when a specific time past?
- How to output comments number of a post per day?
- Human Time Diff, change mins to minutes
- Display custom post types by date field
- Displaying Page Title on index.php
- How can I display a specific user’s first published post?
- generate unique slug while inserting post
- How do I get the slug of a custom taxonomy category of a post?
- Can wordpress differentiate between added and updated posts?
- Fetch posts from current week (Sunday to Saturday)
- How to intercept Post Title on Post-Save
- Testing for post title in ‘if/else’ statement returns no content
- get_post_field – Title without paragraph
- Add Category name to Post Title (h1)
- How to add a custom field after wp post
- Sorting posts alphabetical that have single digits
- How to set post expiration date and time and move the page to archive after expiration [closed]
- How Can i Get 5 Recent Post Title With Corresponding Link?
- How to get posts by multiple post slugs? [duplicate]
- Define a name to the posts slug
- I want to show category in the post title , how can I do
- How to prevent WordPress from updating the modified time?
- Bulk update post slugs through database
- Display post from specific date
- Get random posts between specific dates / of specific age
- How to display following posts titles in separate div’s on a separate webpage
- XML-RPC and post_date
- Blog Posts not showing title
- Automatically republish old posts
- Lose “Blog Archive” from page title
- Replace ‘published on date’ with ‘modified on date’ on Posts
- pre_get_posts query between 2 dates (date stored in custom post meta)
- How to Orderby Comments by post title?
- How can I show many posts an author has per week?
- If modified on same day, show only time
- WordPress not opening posts with only numbers if permalink is post_name
- Update all comments time to random dates?
- How to have posts have a parent in permalink like site.com/blog/postname
- Automatically add date to the auto generation of post slug
- How to handle broken links created by permalink/slug changes?
- Visting slug for ‘post’ post type shows 404 not archive?
- Remove Custom Post Type Slug and add Custom Taxonomy to Permalink Structure?
- WordPress Sidebar menu for posts based on date – guidance needed
- how do i add posts-page slug before posts slug in permalinks
- sql select for post_title and a term name
- date issue with category post retrival
- WordPress is replacing double minus signs in Post Title, how to disable it?
- How do I change the core post search algorithm? Where is it found/constructed?
- How to get date of post when using wp_get_recent_posts()?
- Is there a way to specify an extra class for a post or page with no title?
- Worpdress function for difference dates
- How to get a post’s content? [closed]
- Add title for previous and next posts to Yoko Theme
- Images inside post title
- Loop doesn’t show title of second post and posts thereafter
- Disable WordPress Archive Conflict Check
- How To capitalize The First Letter Of Every Word In The Post Title
- How to show show the Second page title in the page
- Changing default WP-Site creation date
- How to get links to the last N posts in a specific category?
- Create a list of posts with topic headdings
- Two Custom Post Types with Identical Articles Competing for the same Slug
- WordPress custom post type with folder structure in slug
- How to get posts published on the latest date?
- Blog post not showing title
- How can I remove the first two words and shorten get_the_title()
- How do I include the category next to the title of a post?
- How to style archive post titles… but only those posts who have comments?