WordPress.org

Ready to get started?Download WordPress

Forums

JSON API
Posts returned from get_post_index have wrong dates (1 post)

  1. havardeidheim
    Member
    Posted 1 year ago #

    Hey.
    We have a problem with the plugin.

    When we call ?json=get_page_index The dates returned are wrong.
    Not only are they not what they are supposed to be, but the modified timestamp is also much older than the created timestamp.

    When we call ?json=get_page&id=2 the correct dates are displayed. Unfortunately we really need to get all the posts in a single operation, so this dosen't help much.

    Below is the relevant returned data for both queries.
    As you can see, both pages have the same id, slug and url, but the dates for the ?json=get_page&id=2 is wrong.

    Wrong dates, note that date is more recent than modified.

    {
    "status": "ok",
    "pages": [
        {
            "id": 2,
            "type": "page",
            "slug": "about",
            "url": "xxx\/about\/",
            "status": "publish",
            "date": "2013-07-05 15:24:02",
            "modified": "2012-08-10 12:22:33",
        }
    ]
    }
    

    Correct dates, note that the dates are completly different, but the modified is the same.

    {
    "status": "ok",
    "page": {
        "id": 2,
        "type": "page",
        "slug": "about",
        "url": "xxx\/about\/",
        "status": "publish",
        "date": "2010-11-05 20:37:40",
        "modified": "2012-08-10 12:22:33",
    }
    }
    

    We could try to fix the code, but since this is a bug that other people might experience as well, i thought i would post it here.
    Have a good day.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic