I found a solution. You have to go to the folder controllers/core.php and there you have to change the function get_recent_posts().
You have to add this code to remove categories that you don’t want:
public function get_recent_posts() {
global $json_api;
// get all the categories from the database
$cats = get_categories();
// loop through the categries
foreach ($cats as $cat) {
// setup the cateogory ID
$cat_id = $cat->term_id;
// create a custom wordpress query
query_posts("cat=-434,-22837,-13571,-1,-18,-17385");
// start the wordpress loop!
while (have_posts()) {
$posts = $json_api->introspector->get_posts();
return $this->posts_result($posts);
}
}
}
Related Posts:
- Keep user’s privileges on accessing contents in JSON response
- CMB2 Repeatable Group & JSON API
- How to use JSON data from URL into table on my wordpress website
- Prevent plugin from intruding on wp-json posts api
- How to set category correctly for a custom post created by a remote API call?
- WordPress output data to another website and pull data
- API page return Header 500 but Work
- WP JSON REST API (Ryan McCue) how to query posts with specific meta data with ‘AND’ relation?
- Change Page’s Tag Using functions.php File
- Get Latest Plugin Version from WP API
- How do I retrieve a list of popular plugins using the WordPress.org Plugin API?
- Restrict access and display for categories
- Can’t use /wp-json/wp/v2/plugins API endpoint even as administrator
- How to display a category list in a mediawiki like way?
- Show the “ratingValue” and “ratingCount” values of KK Star Ratings Plugin
- Does the WordPress API have Modal Dialogs
- How to use get_categories() with Event Organiser plugin
- How to get all events from ‘All in one Events calender’ plugin in JSON format?
- What is the best way to move a plugin´s subdirectory+files to wp-content/uploads-directory?
- Create or Update thousands of woocommerce products via PHP
- Looking for a solution – slightly convoluted problem
- Custom Post Type Plugin not loading category template and loading 404 instead
- Display content from custom post type if match to main post category
- Getting a List of Categories for Use in a Plugin?
- WordPress category add image field
- Using WP Category Lists Plugin to Dynamically Display Category (PHP)
- Excluding a category from wp_query breaks recent post widget
- Trouble with editing template for “List category posts” plugin
- Any built-in function to associate a post to category through a plugin?
- How to display the “ratingValue” and “ratingCount” values generated by the KK Star Ratings plugin into my page’s recipe ld+json schema
- wp_remote_get() returns 403 while file_get_contents() does not
- AJAX in plugin wp_send_json() sending html
- Redirecting thousands of posts that currently have no category in their permalink when changing permalink structure to include category
- How to disable search as you type plugin suggestions?
- Set plugin-values when creating post via REST-API
- Automatically Assign Author to Category [closed]
- polylang + category/tag custom language link
- How to display taxonomy images with wp_list_categories?
- Plugin is a widget, but I want to call it in the head, can I?
- How do I rename a category in the menu bar only?
- Best/Correct way to add an option to a category
- How to Include Fields in Query String When Making Request of WordPress.org Plugin API?
- .php file for woocommerce edit category? [closed]
- How to get a list of all the available plugins names
- Mutliple users editing single document in wordspress
- Call Ajax URL in Plugin
- How to add category and subcategory in WordPress custom code?
- How can recognize post’s category?
- How do I display PHP file contents on front end of WordPress?
- how to show all posts of each category in pages
- Custom Post Type same name as Category
- Display posts by alphabetical order
- How to add a PW Gift Card to a Woocommerce Order request API?
- How to display category list with category featured image
- In a plugin, How to update a json file using ajax
- Getting the same post on my related post
- Precheck fields when I add a new post
- How to use Datatable with Ajax when creating plugin on WordPress?
- automatically set random featured image by category in wordpress on post
- how can I edit the HTML of yith ajax product filter
- CRUD from WordPress to Business Central 365 through OData REST API
- How to get data from a private API and add it to wordpress pages
- Create API for registering user on wordpress site with 3rd party site
- WordPress Categories as a Grid
- Different function call depending on shortcode?
- How to allow editors to only edit certain categories?
- Plugin json page
- How to find out programmatically whether any cache plugin is installed in the WordPress website?
- Category as Subdomain for One WP Install
- Woocommerce categories displayed on every category and shopping page
- woocommerce product search based only title
- In the WordPress API is there a way to set the width of the post/page container
- Related post based on 2 categories
- Populate select option with JSON file
- WordPress, modular content, and syndication
- How to insert category name above post title in a featured pages plugin?
- create web service for android app using wordpress website
- API Functions to Register and Show WordPress List Tables
- WordPress Categories from Plugin
- Showpost and last
- Is it possible to setup Category wise Subsciption?
- Filter EVERY category link with my plugin
- Category archive in menu
- CSV file header
- Find And Add Category to Posts
- Retrieve post thumbnails
- Synch Custom Post Types (and Custom Fields, Cats, etc.) Between WordPress Sites
- wp_insert_post_data filter to set category
- wordpress plugin JSON API search within specific category
- 404 not found problem with URL rewrite custom category
- Automatically set posts to NoIndex depending on category?
- Output pure JSON wordpress
- how to know that a wordpress plugin support using API?
- How to pre-set WordPress settings for specific posts?
- How can I send api calls from my plugin?
- Can i have limit posts on a specific category and automatically remove older ones?
- Am having issues intergrating this api into my wordpress site, any help please?
- Store large dataset in WordPress installation temporary
- Is it possible to create post in wordpress using postman?
- Categories not showing when all of the posts are private