WordPress.org

Ready to get started?Download WordPress

Forums

JSON API
get_recent_posts full article instead of excerpt (2 posts)

  1. greatwitenorth
    Member
    Posted 1 year ago #

    Does anyone know if it's possible to get the full post for get_recent_posts instead of just the excerpt. I tried something like this in my functions.php file but it didn't work:

    add_action('json_api-core-get_recent_posts', 'my_get_recent_posts');
    function my_get_recent_posts(){
    	global $more;
    	$more = 0;
    	return;
    }

    http://wordpress.org/extend/plugins/json-api/

  2. greatwitenorth
    Member
    Posted 1 year ago #

    I found a way to do this but it requires modifying some of the plugin code. Edit the introspector.php in the singletons folder and change the following from this (starting on line 6):

    global $post;
    $this->set_posts_query($query);
    $output = array();

    to this:

    global $post, $more;
    $this->set_posts_query($query);
    $output = array();
    $more = -1;

    Setting the $more variable to -1 tells wordpress to output the full article regardless if there is a more tag or not.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic