Why doesn't WordPress set post_date_gmt on drafts?
-
When inserting draft posts, why does WordPress set
post_date
, but notpost_date_gmt
? I think if you have two columns in your database, one for representing local time (post_date
) and one for GMT time (post_date_gmt
), both should always be set/updated together for consistency.This is from
post.php
:if ( empty($post_date_gmt) || '0000-00-00 00:00:00' == $post_date_gmt ) { if ( !in_array( $post_status, array( 'draft', 'pending', 'auto-draft' ) ) ) $post_date_gmt = get_gmt_from_date($post_date); else $post_date_gmt = '0000-00-00 00:00:00'; }
- The topic ‘Why doesn't WordPress set post_date_gmt on drafts?’ is closed to new replies.