• Resolved tiptronic

    (@tiptronic)


    Is there a way to use this plugin to filter on the ‘modified’ date of a post?

    I tried using any combination of filter[modified]=2017-04-13T11:19:18 or
    filter[key]=modified
    filter[compare]=’>=’
    filter[value]=2017-04-13T11:19:18
    or
    filter[meta-key]=modified
    filter[compare]=’>=’
    filter[meta-value]=2017-04-13T11:19:18

    but it always returns all or none posts.

    What am I missing here?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author sk8tech

    (@sk8tech)

    Hello, Thank you for your post. A good suggestion, however it’s not supported yet.

    Have a look at WP REST Handbook though, the ‘before’ argument might be what you’re looking for?

    Thread Starter tiptronic

    (@tiptronic)

    Hi
    thx for your reply!
    I can’t see, however, how the ‘BEFORE’ Filter could help me, if I’m looking for something ‘AFTER’ a certain date…
    a.

    Plugin Author sk8tech

    (@sk8tech)

    Not sure if it helps but…There is also a ‘AFTER’ filter from the official WP REST API. Please see WP REST Handbook for more reference.

    Plugin Author sk8tech

    (@sk8tech)

    @tiptronic

    Thank you for your feedback. We’ve updated the plugin, now you can do it like this!

    https://domain.com/wp-json/wp/v2/cars?
    filter[meta_key]=post_modified&
    filter[meta_value]=2018-12-27T23:59:59&
    filter[meta_compare]=<

    This represents ‘cars’ with ‘post_modified’ date ‘less’ or before ‘2018 Boxing day ends’

    meta_key can be ‘post_date’, ‘post_date_gmt’, ‘post_modified’, ‘post_modified_gmt’, ‘comment_date’, ‘comment_date_gmt’, or any Advanced Custom Field meta_key.
    meta_compare can be <, =, >

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Filter modified greater than date’ is closed to new replies.