I have an idea to change the value of post_modified
, so the value will have the same value with the post_date
.
But Wordpress has a revision system, so I want to change the post_modified
on the revision to have a same value with post_date
.
Here is my query to change it:
$query = "UPDATE $wpdb->posts
SET
post_modified = '$recent->post_date',
post_modified_gmt = '$recent->post_date_gmt'
WHERE
ID = '$update->ID'";
$wpdb->query($query);
$recent->post_date is the post_date (scheduled time / time where our post will appear in the website)
$recent->post_date_gmt is post_date_gmt
$update->ID
is the revision ID in posts table.
But when I run the query, it doesn't change the value and stops my plugin.
Is there something I missed? Or is it that Wordpress itself doesn't allow us to change the post_modified
?