Checks the post_date_gmt or modified_gmt and prepare any post or modified date for single post output.
Parameters
$date_gmt
stringrequired- GMT publication time.
$date
string|nulloptional- Local publication time.
Default:
null
Source
protected function prepare_date_response( $date_gmt, $date = null ) {
if ( '0000-00-00 00:00:00' === $date_gmt ) {
return null;
}
if ( isset( $date ) ) {
return mysql_to_rfc3339( $date );
}
return mysql_to_rfc3339( $date_gmt );
}
Changelog
Version | Description |
---|---|
4.7.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.