简体   繁体   中英

Wordpress json-api plugin get recent posts from specified date up to today

I am using a plugin for WordPress called json-api, and it has a function to get recent posts. I am assuming its only called within the last 24 hours, but I wanted to modify it so I could give it a parameter to pull specifically by last 24 hours or 1 for days, then 2 for two days or 48 hours, ect.....

This is the plugin: https://wordpress.org/plugins/json-api/

I am able to modify the plugin if need too.

This is the function for that:

public function get_recent_posts_by_day() {
global $json_api;
$posts = $json_api->introspector->get_posts();
return $this->posts_result($posts);}

Here is an example link to the plugin for get_recent_posts

I have tried: http://alexbachuk.com/api/get_recent_posts&after=20140806/

What I want to accomplish is either specifying a date and get all post from that date up until today.

Okay, I have got it to work with this: http://alexbachuk.com/api/get_recent_posts/?after=20150806&count=400

Fix: /api/get_recent_posts/?after=20150806&count=400

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM