Skip to content
This repository was archived by the owner on Sep 24, 2018. It is now read-only.

Commit 29c768b

Browse files
committed
Move comment_date_gmt response parameter into edit context only.
1 parent 2186854 commit 29c768b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/class-wp-json-comments-controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ public function prepare_item_for_response( $comment, $request ) {
214214
'author_email' => $comment->comment_author_email,
215215
'author_url' => $comment->comment_author_url,
216216
'date' => json_mysql_to_rfc3339( $comment->comment_date ),
217-
'date_gmt' => json_mysql_to_rfc3339( $comment->comment_date_gmt ),
218217
'content' => array(
219218
'rendered' => apply_filters( 'comment_text', $comment->comment_content, $comment ),
220219
),
@@ -223,6 +222,7 @@ public function prepare_item_for_response( $comment, $request ) {
223222
);
224223

225224
if ( 'edit' == $request['context'] ) {
225+
$fields['date_gmt'] = json_mysql_to_rfc3339( $comment->comment_date_gmt );
226226
$fields['content']['raw'] = $comment->comment_content;
227227
}
228228

0 commit comments

Comments
 (0)