admin管理员组

文章数量:1417070

Is there a way to update a post (published) date when you change the category/taxonomy to a specific one?

Example: - Post type "Projects" - 2 categories: Progress/ Done When you change the category for the post "Project One" (from Progress) to Done, the published date has to be the currect date and time, zo it will be the last published post.

Is there a way to update a post (published) date when you change the category/taxonomy to a specific one?

Example: - Post type "Projects" - 2 categories: Progress/ Done When you change the category for the post "Project One" (from Progress) to Done, the published date has to be the currect date and time, zo it will be the last published post.

Share Improve this question asked Aug 11, 2019 at 8:17 DannyDanny 136 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

You can display the date the post was last modified, using the Default date format setting (e.g. F j, Y) from Administration > Settings > General. Here is a code using Default date formate.

<p><?php printf( __( 'Last modified: %s', 'textdomain' ), get_the_modified_date() ); ?></p>

本文标签: Update post (published) date when changing category