[wp-trac] [WordPress Trac] #50617: REST API: Add modified_before and modified_after to WP_REST_Request attributes
WordPress Trac
noreply at wordpress.org
Wed Aug 26 20:10:43 UTC 2020
#50617: REST API: Add modified_before and modified_after to WP_REST_Request
attributes
------------------------------------------+------------------------------
Reporter: claytoncollie | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version:
Severity: normal | Resolution:
Keywords: needs-patch needs-unit-tests | Focuses:
------------------------------------------+------------------------------
Changes (by claytoncollie):
* keywords: has-patch has-unit-tests => needs-patch needs-unit-tests
Comment:
@SergeyBiryukov I wrote a patch for this ticket. Happy to make changes as
you see fit. I do have a couple of questions.
1. I am using the `post_modified` field for the request. Should I use
`post_modified_gmt` instead?
https://core.trac.wordpress.org/browser/tags/5.5/src/wp-includes/class-wp-
post.php#L151
WP_Query date_query defaults to `post_date` so I think `post_modified` is
correct.
https://developer.wordpress.org/reference/classes/wp_query/#date-
parameters
2. I ported my changes to the Comments controller as well since it uses
the same request arguments. Is that alright for the scope of this ticket?
3. I wrote tests for Posts, Pages, and Attachments since they all used
similar request/test methods. Is that alright for the scope of this
ticket?
4. Do I need to open a PR to update the documentation at
https://github.com/WP-API/docs/blob/master/requests.md
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50617#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list