WordPress ME の更新日付フィールド

WordPress ME で、テーブル_wp_posts の post_modified フィールドがまったく利用されていないのに気づいた。本来、記事が書かれたり更新されたときに、そのフィールドに NOW() を入れるのが正しいのではないかと思い、勝手にパッチしてみた。

$ !diff
diff post.php.orig post.php
118c118
< (ID, post_author, post_date, post_content, post_title, post_lat, post_lon, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping) --- > (ID, post_author, post_date, post_content, post_title, post_lat, post_lon, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping, post_modified)
120c120
< (\'0\', \'$user_ID\', \'$now\', \'$content\', \'$post_title\', $post_latf, $post_lonf,\'$excerpt\', \'$post_status\', \'$comment_status\', \'$ping_status\', \'$post_password\', \'$post_name\', \'$trackback\') --- > (\’0\’, \’$user_ID\’, \’$now\’, \’$content\’, \’$post_title\’, $post_latf, $post_lonf,\’$excerpt\’, \’$post_status\’, \’$comment_status\’, \’$ping_status\’, \’$post_password\’, \’$post_name\’, \’$trackback\’, NOW() )
124c124
< (ID, post_author, post_date, post_content, post_title, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping) --- > (ID, post_author, post_date, post_content, post_title, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping, post_modified)
126c126
< (\'0\', \'$user_ID\', \'$now\', \'$content\', \'$post_title\', \'$excerpt\', \'$post_status\', \'$comment_status\', \'$ping_status\', \'$post_password\', \'$post_name\', \'$trackback\') --- > (\’0\’, \’$user_ID\’, \’$now\’, \’$content\’, \’$post_title\’, \’$excerpt\’, \’$post_status\’, \’$comment_status\’, \’$ping_status\’, \’$post_password\’, \’$post_name\’, \’$trackback\’, NOW())
321a322
> post_modified = NOW(),

どうだろうか?

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

*

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください