Checks the post_date_gmt or modified_gmt and prepare any post or modified date for single post output.
Description
Duplicate of WP_REST_Revisions_Controller::prepare_date_response() .
Parameters
$date_gmt
stringrequired- GMT publication time.
$date
string|nulloptional- Local publication time.
Default:
null
Source
}
if ( rest_is_field_included( 'modified', $fields ) ) {
$data['modified'] = $this->prepare_date_response( $post->post_modified_gmt, $post->post_modified );
}
if ( rest_is_field_included( 'modified_gmt', $fields ) ) {
$data['modified_gmt'] = $this->prepare_date_response( $post->post_modified_gmt );
}
if ( rest_is_field_included( 'parent', $fields ) ) {
Changelog
Version | Description |
---|---|
6.3.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.