All Projects → bueltge → wp-rest-api-filter-items

bueltge / wp-rest-api-filter-items

Licence: GPL-2.0 license
A WordPress plugin that filters WP REST API items to your requirement.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to wp-rest-api-filter-items

wordpress-day-spa
Example Vue.js-powered SPA running in the WordPress Admin with vue-router and vue-loader
Stars: ✭ 18 (-70.49%)
Mutual labels:  wordpress-plugin, wp-api
wp-rest-blocks
Add gutenberg blocks data into post / page / widget REST API endpoints.
Stars: ✭ 86 (+40.98%)
Mutual labels:  wordpress-plugin
sunny
Automatically purge Cloudflare cache, including cache everything rules.
Stars: ✭ 35 (-42.62%)
Mutual labels:  wordpress-plugin
wp-useronline
Enable you to display how many users are online on your WordPress blog with detailed statistics.
Stars: ✭ 37 (-39.34%)
Mutual labels:  wordpress-plugin
acf-swatch
ACF Color Swatch Field
Stars: ✭ 67 (+9.84%)
Mutual labels:  wordpress-plugin
book-review-library
A book cataloguing and review system designed with bookophiles and librarians in mind.
Stars: ✭ 13 (-78.69%)
Mutual labels:  wordpress-plugin
wemail
Send Affordable Bulk Email Campaign Through WordPress
Stars: ✭ 19 (-68.85%)
Mutual labels:  wordpress-plugin
WP-Stash
Bridge between WordPress and StashPHP, providing a PSR6-compliant caching system for WordPress
Stars: ✭ 31 (-49.18%)
Mutual labels:  wordpress-plugin
spoken-word
Spoken Word
Stars: ✭ 46 (-24.59%)
Mutual labels:  wordpress-plugin
wp-video-embed-privacy
Wordpress plugin for making ebedding videos GDPR compliant
Stars: ✭ 33 (-45.9%)
Mutual labels:  wordpress-plugin
Inactive-Logout
Development copy from the WordPress repository. Will release here first.
Stars: ✭ 19 (-68.85%)
Mutual labels:  wordpress-plugin
sign-in-with-apple
A WordPress plugin for Sign In with Apple
Stars: ✭ 47 (-22.95%)
Mutual labels:  wordpress-plugin
wp-block-description-list
A wordpress gutenberg block plugin for description lists.
Stars: ✭ 17 (-72.13%)
Mutual labels:  wordpress-plugin
wordpress-ostatus
An OStatus plugin for WordPress
Stars: ✭ 21 (-65.57%)
Mutual labels:  wordpress-plugin
advanced-responsive-video-embedder
Probably the the best WP plugin for embedding videos.
Stars: ✭ 32 (-47.54%)
Mutual labels:  wordpress-plugin
wp-cloud-deploy
WPCloudDeploy is a WordPress plugin that allows you to easily deploy and manage your own dedicated high-performance WordPress servers and sites at any cloud server provider.
Stars: ✭ 28 (-54.1%)
Mutual labels:  wordpress-plugin
WooCommerce-Multiple-Free-Gift
WooCommerce giveaway made easy.
Stars: ✭ 24 (-60.66%)
Mutual labels:  wordpress-plugin
woocommerce-dadata
WooCommerce DaData
Stars: ✭ 22 (-63.93%)
Mutual labels:  wordpress-plugin
perfecty-push-wp
WordPress plugin for self-hosted Web Push Notifications ⚡️
Stars: ✭ 32 (-47.54%)
Mutual labels:  wordpress-plugin
wp-dispensary
🌿 WP Dispensary - online menu management for dispensaries
Stars: ✭ 60 (-1.64%)
Mutual labels:  wordpress-plugin

WP REST API Filter Items

Unit Tests Build Status Code Climate License

A WordPress plugin to filters WordPress REST API items for your request. Its removing key and values from WP API response on your request.

Description

Per default, a post via WordPress REST API would fetch all data in wp-json/wp/v2/posts. For many reasons, you might want to exclude certain fields from WP API response in certain circumstances. This plugin enables you to filter your request for fields you require. Add items to the GET attribute on the url, like wp-json/wp/v2/posts?items=id,title,content in order to get only according field values.

The plugin currently supports the filtering of post, taxonomy and comments.

WP-API Versions

  • Use the branch wp-api-v1 if you use WP-API Version 1.
  • The master branch is for development, currently ready and open for feature requests for the WP API Version 2.

Installation

Install static via download, clone the repository or use dependency management via Composer

composer require bueltge/wp-rest-api-filter-items

Examples

Result for post: wp-json/wp/v2/posts?_wp_json_nonce=4355d0c4b3&items=id,title,content

[
	{
		"id": 1,
		"title": {
			"rendered": "Hello world!"
		},
		"content": {
			"rendered": "<p>Welcome to <a href=\"http://localhost/wpbeta/\">WP Beta Dev Sites</a>. This is your first post. Edit or delete it, then start blogging!</p>\n"
		}
	}
]

Result for taxonomy: p-json/wp/v2/taxonomies/category?_wp_json_nonce=4355d0c4b3&items=name,slug,types.

{
	"name": "Categories",
	"slug": "category",
	"types": [
		"post",
		"archiv"
	]
}

Result for comments: wp-json/wp/v2/comments?items=id,author_name

[
	{
		"id": 1,
		"author_name": "Mr WordPress"
	},
	{
		"id": 2,
		"author_name": "admin"
	}
]

Requirements

  • PHP 5.4
  • WordPress 4.*
  • WP REST API

Kudos

Thanks @dnaber-de for his modular, extendable PHP autoloader.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].