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
- Error 400 Invalid “products[1].productId” Kinguin [closed]
- How to display the “ratingValue” and “ratingCount” values generated by the KK Star Ratings plugin into my page’s recipe ld+json schema
- How to modify WCMP Rest API response?
- wordpress json api not working
- How to fetch products with the price in a page on woocommerce using a form or live search with php
- Display by Category in Admin
- Search for categories
- wp_remote_get() returns 403 while file_get_contents() does not
- AJAX in plugin wp_send_json() sending html
- Limit post creation by role
- Redirecting thousands of posts that currently have no category in their permalink when changing permalink structure to include category
- Blog titles from WP blog on plain html site?
- How to disable search as you type plugin suggestions?
- Customize permalink wordpress category id
- Set plugin-values when creating post via REST-API
- Automatically Assign Author to Category [closed]
- Custom Pages for Woocommerce Product-Category Pages
- polylang + category/tag custom language link
- How to password protect a category page / not posts?
- How to display taxonomy images with wp_list_categories?
- WordPress does not show products when the value of post_parent is not 0
- Using arbitrary paths in page urls
- WordPress “Categories to tags converter” not working. Pointing to import.php instead
- WordPress api call using wp-ajax returns error 400
- How do I apply style to each category of a list?
- Redirect to another page using contact form 7? [closed]
- WordPress stats API key
- Plugin is a widget, but I want to call it in the head, can I?
- Great blogs site resources/tutorial for WordPress Developers? [closed]
- Recent posts per category loop?
- Socialite WP plugin, unable to obtain API keys from FB
- How to pass the API key to the client from the database? [closed]
- Getting a Page via its post-name using WP REST API v2 and Postman
- Create WordPress posts from JSON array using plugin in admin
- How do I rename a category in the menu bar only?
- Ambrosite Next/Previous Post Link Plus or WP next_post_link to cycle through top level category
- Adding inside wp-plugin jQuery script that receives JSON-formatted data, generated by php-function inside this plugin
- Is changing post from category in a large blog a good practice?
- Best/Correct way to add an option to a category
- Integrating boxtal PHP library into a custom WordPress Plugin
- How to get theme’s info from wordpress.org/themes using api.wordpress.org?
- Custom API plugin to execute 3rd party API to retrieve data
- URL rewrite with external JSON query
- How to Include Fields in Query String When Making Request of WordPress.org Plugin API?
- .php file for woocommerce edit category? [closed]
- check uncategorized category by default
- Sending customer an email with link to stripe to make payment
- Api external with wordpress
- How to get a list of all the available plugins names
- How can ι create my own (custom) WordPress table/list?
- WP Rest API and json_decode()
- Mutliple users editing single document in wordspress
- Call Ajax URL in Plugin
- Can i use init hook for API purpose?
- How to add category and subcategory in WordPress custom code?
- WooCommerce Hiding A Certain Category From Being Displayed On Single Product
- How can recognize post’s category?
- How can i listing current category and Featured Category post list?
- Categories from front-end, checkbox selection doesn’t work
- Including content from legacy app: via plugin or custom content?
- Why may one avoid Jetpack plugin? [closed]
- How to get Recent Post From Each Category with Thumbnail?
- Category “same post” retreive and display
- Add a new category for posts
- How to convert Currency from USD to other IP Based currency in Php function
- How to overwrite the category template in a plugin
- How to hide featured images of all posts falling under the same category in wordpress?
- How do I display PHP file contents on front end of WordPress?
- Upload Javascript and json webpage to wordpress
- how to show all posts of each category in pages
- Custom Post Type same name as Category
- I’m receiving the following error using the below code: Uncaught Error: Cannot use object of type WP_REST_Response as array
- Visual composer custom element error
- Push Contact form 7 variable to front end after submission
- Display posts by alphabetical order
- How to add a PW Gift Card to a Woocommerce Order request API?
- How to display the category name in the tab and post inside the tab in WordPress?
- Adding custom post category to categories widget
- Custom Post Type with Sequence ID
- Escape commas in REST API
- WordPress default post categories meta box widget
- 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
- Ability to change homepage on WordPress using API
- Do i need to use a plugin for third party api integration?
- Precheck fields when I add a new post
- exclude particular category in api
- What plugin would make this happen? If is the theme
- How to use third-party SendGrid Email Validation API in Gravity Forms?
- How to use Datatable with Ajax when creating plugin on WordPress?
- automatically set random featured image by category in wordpress on post
- is it possible to fetch data from a remote api while admin is writing a new post?