• hi i build an apk and the template use this api.

    All works fine.
    The only problem is that in app appears the future posts.

    How can i hide them and display only the published posts and not the scheduled?
    Thanks

Viewing 1 replies (of 1 total)
  • hi
    go to plugin root and select singletons folder and find and open introspector.php
    find your function and add new line below query. for sample:

    public function get_posts($query = false, $wp_posts = false) {
    global $post, $wp_query;
    $this->set_posts_query($query);
    $output = array();
    ///// this line
    $args = array_merge( $wp_query->query, array( ‘post_type’ => ‘post’, ‘post_status’ => ‘publish ) );

    query_posts( $args );
    while (have_posts()) {
    the_post();
    if ($wp_posts) {
    $new_post = $post;
    } else {
    $new_post = new JSON_API_Post($post);
    }
    $output[] = $new_post;
    }
    return $output;
    }

    //////////or this line
    $args = array( ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’ );

Viewing 1 replies (of 1 total)
  • The topic ‘Future posts’ is closed to new replies.