• Resolved vespino

    (@vespino)


    Is it possible to show the complete content value in the get_category_posts method? Only the excerpt + read more is returned now.

    I’m also looking for a way to only return the full image instead of all images. thumbnail + thumbnail_images => full.

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter vespino

    (@vespino)

    I have changed this:

    $this->set_content_value();

    To:

    $this->set_value(‘content’, apply_filters(‘the_content’, $wp_post->post_content));

    in the models/post.php file as a temporary solution. If someone has a better one, one that will not reset when an update presents itself, I’d love to hear it!

    Thread Starter vespino

    (@vespino)

    Solved the problem by adding the following to my functions.php file:

    function remove_more_json_api($content) {
    if(get_query_var(‘json’)){
    global $post;
    $content = preg_replace(‘/<!–more(.*?)?–>/’,”,$post->post_content);
    }
    return $content;
    }
    add_filter(‘the_content’, ‘remove_more_json_api’, 1);

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Complete "content" in get_category_posts method’ is closed to new replies.