我有一个改变 的值的想法post_modified
,因此该值将与 具有相同的值post_date
。
但是 Wordpress 有一个修订系统,所以我想将post_modified
修订上的 更改为与post_date
.
这是我更改它的查询:
$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
是帖子表中的修订 ID。
但是当我运行查询时,它不会更改值并停止我的插件。
有什么我错过的吗?还是 Wordpress 本身不允许我们更改post_modified
?