{"id":15498042,"url":"https://github.com/bueltge/wp-rest-api-filter-items","last_synced_at":"2025-04-19T11:53:31.422Z","repository":{"id":31118262,"uuid":"34677785","full_name":"bueltge/wp-rest-api-filter-items","owner":"bueltge","description":"A WordPress plugin that filters WP REST API items to your requirement.","archived":false,"fork":false,"pushed_at":"2021-02-05T20:31:15.000Z","size":59,"stargazers_count":64,"open_issues_count":2,"forks_count":14,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-10-19T14:26:09.618Z","etag":null,"topics":["rest-api","wordpress","wordpress-plugin","wp-api"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bueltge.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"bueltge","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://bueltge.de/impressum/#hinweis"}},"created_at":"2015-04-27T16:26:30.000Z","updated_at":"2024-10-03T04:38:44.000Z","dependencies_parsed_at":"2022-09-13T21:00:12.777Z","dependency_job_id":null,"html_url":"https://github.com/bueltge/wp-rest-api-filter-items","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bueltge%2Fwp-rest-api-filter-items","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bueltge%2Fwp-rest-api-filter-items/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bueltge%2Fwp-rest-api-filter-items/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bueltge%2Fwp-rest-api-filter-items/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bueltge","download_url":"https://codeload.github.com/bueltge/wp-rest-api-filter-items/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249688951,"owners_count":21311306,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rest-api","wordpress","wordpress-plugin","wp-api"],"created_at":"2024-10-02T08:41:44.962Z","updated_at":"2025-04-19T11:53:31.404Z","avatar_url":"https://github.com/bueltge.png","language":"PHP","readme":"# WP REST API Filter Items\n[![Unit Tests](https://github.com/bueltge/wp-rest-api-filter-items/workflows/PHP%20Unit%20Tests/badge.svg)](https://github.com/bueltge/wp-rest-api-filter-items/actions)\n[![Build Status](https://travis-ci.org/bueltge/wp-rest-api-filter-items.svg?branch=master)](https://travis-ci.org/bueltge/wp-rest-api-filter-items) [![Code Climate](https://codeclimate.com/github/bueltge/wp-rest-api-filter-items/badges/gpa.svg)](https://codeclimate.com/github/bueltge/wp-rest-api-filter-items) [![License](https://poser.pugx.org/bueltge/wp-rest-api-filter-items/license)](https://packagist.org/packages/bueltge/wp-rest-api-filter-items)\n\nA WordPress plugin to filters [WordPress REST API](http://wp-api.org/) items for your request. Its removing key and values from WP API response on your request.\n\n## Description\nPer 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.\n\nThe plugin currently supports the filtering of post, taxonomy and comments.\n\n## WP-API Versions\n * __Use the branch [`wp-api-v1`](tree/wp-api-v1) if you use WP-API Version 1.__\n * The **`master` branch** is for development, currently ready and open for feature requests for the **WP API Version 2**.\n\n## Installation\nInstall static via download, clone the repository or use dependency management via Composer\n\n`composer require bueltge/wp-rest-api-filter-items`\n\n## Examples\n#### Result for post: `wp-json/wp/v2/posts?_wp_json_nonce=4355d0c4b3\u0026items=id,title,content`\n```json\n[\n\t{\n\t\t\"id\": 1,\n\t\t\"title\": {\n\t\t\t\"rendered\": \"Hello world!\"\n\t\t},\n\t\t\"content\": {\n\t\t\t\"rendered\": \"\u003cp\u003eWelcome to \u003ca href=\\\"http://localhost/wpbeta/\\\"\u003eWP Beta Dev Sites\u003c/a\u003e. This is your first post. Edit or delete it, then start blogging!\u003c/p\u003e\\n\"\n\t\t}\n\t}\n]\n```\n\n#### Result for taxonomy: `p-json/wp/v2/taxonomies/category?_wp_json_nonce=4355d0c4b3\u0026items=name,slug,types`.\n```json\n{\n\t\"name\": \"Categories\",\n\t\"slug\": \"category\",\n\t\"types\": [\n\t\t\"post\",\n\t\t\"archiv\"\n\t]\n}\n```\n\n#### Result for comments: `wp-json/wp/v2/comments?items=id,author_name`\n```json\n[\n\t{\n\t\t\"id\": 1,\n\t\t\"author_name\": \"Mr WordPress\"\n\t},\n\t{\n\t\t\"id\": 2,\n\t\t\"author_name\": \"admin\"\n\t}\n]\n```\n\n## Requirements\n * PHP 5.4\n * WordPress 4.*\n * WP REST API\n\n## Kudos\nThanks @dnaber-de for his [modular, extendable PHP autoloader](https://github.com/dnaber-de/Requisite).\n","funding_links":["https://github.com/sponsors/bueltge","https://bueltge.de/impressum/#hinweis"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbueltge%2Fwp-rest-api-filter-items","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbueltge%2Fwp-rest-api-filter-items","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbueltge%2Fwp-rest-api-filter-items/lists"}