Support » Plugin: JSON API » any plans to handle post_status

  • Hi,
    According to the documentation, this fantastic plug-in ignores nowadays the post_status parameter.
    Any plans for adding this? Or is there any workaround?
    In my case I need to download posts which are planned to be published (future value of post_status, I suppose).
    Any help will be appreciated.

Viewing 1 replies (of 1 total)
  • For all others interested:
    I’ve achieved it by modifying introspector class, set_posts_query function, where I’ve just added this line:

    $query['post_status'] = array( 'publish', 'future' );
    before last if.

    This is quite primitive way and probably will not work well in case of other post_status values (authorization consideration if status is draft) but works fine for planned posts.

    I don’t know php and maybe that’s why I don’t understand, how it works, that in the mentioned function there are lines of sort:
    some_var = $json_api->query->post_type
    i.e. post_type field is referenced, but I couldn’t find any definition/declaration of post_type field in query object, which is JSON_API_Query type, as far I understand.

Viewing 1 replies (of 1 total)
  • The topic ‘any plans to handle post_status’ is closed to new replies.