• Anonymous User 92042

    (@anonymized-92042)


    WP REST API 1.2.2
    WordPress 4.2.2

    I’ve come across a problem where the WP API will sometimes return null in place of the post date.

    Doing some testing, I’ve identified the problem as being related to posts with an incorrect post_date_gmt of “0000-00-00 00:00:00” (how this is happening is a separate issue). These posts all have correct post_date values however.

    When retrieving these posts, the plugin will return null for both date and date_gmt.

    Changing post_date_gmt to “0000-00-00 00:00:01” fixes the problem.

    Any thoughts on this would be great but I suspect this is more of a bug report than something I can get some help with in the short term. Suggestions are welcome though.

    https://ww.wp.xz.cn/plugins/json-rest-api/

The topic ‘NULL dates returned for some posts’ is closed to new replies.