All Projects → factor1 → Better Rest Endpoints

factor1 / Better Rest Endpoints

Licence: gpl-3.0
A WordPress plugin that serves up slimmer WP Rest API endpoints.

Projects that are alternatives of or similar to Better Rest Endpoints

Acf To Rest Api
Exposes Advanced Custom Fields Endpoints in the WordPress REST API
Stars: ✭ 1,152 (+1957.14%)
Mutual labels:  api, wordpress, wordpress-plugin
Ultimate Fields
The plugin for custom fields in WordPress
Stars: ✭ 39 (-30.36%)
Mutual labels:  wordpress-api, wordpress, wordpress-plugin
Restsplain
WordPress REST API documentation generator
Stars: ✭ 126 (+125%)
Mutual labels:  wordpress-api, wordpress, wordpress-plugin
The Seo Framework
The SEO Framework WordPress plugin.
Stars: ✭ 329 (+487.5%)
Mutual labels:  api, wordpress, wordpress-plugin
Co Cart
🛒 CoCart is a flexible, open-source solution to enabling the shopping cart via the REST API for WooCommerce.
Stars: ✭ 198 (+253.57%)
Mutual labels:  api, wordpress, wordpress-plugin
Pop
Monorepo of the PoP project, including: a server-side component model in PHP, a GraphQL server, a GraphQL API plugin for WordPress, and a website builder
Stars: ✭ 160 (+185.71%)
Mutual labels:  api, wordpress, wordpress-plugin
Live Composer Page Builder
Free page builder plugin for WordPress http://livecomposerplugin.com
Stars: ✭ 143 (+155.36%)
Mutual labels:  wordpress-api, wordpress, wordpress-plugin
Wp Graphql Gutenberg
Query gutenberg blocks with wp-graphql
Stars: ✭ 158 (+182.14%)
Mutual labels:  api, wordpress, wordpress-plugin
Wp Graphql
🚀 GraphQL API for WordPress
Stars: ✭ 3,097 (+5430.36%)
Mutual labels:  api, wordpress, wordpress-plugin
Intervention
WordPress plugin to configure wp-admin and application state using a single config file.
Stars: ✭ 481 (+758.93%)
Mutual labels:  wordpress-api, wordpress, wordpress-plugin
Hybrid
[I don't have time to work on this anymore. Use at your own risk] Build WordPress based PWA, iOS, Android & Windows phones apps in minutes!
Stars: ✭ 1,026 (+1732.14%)
Mutual labels:  wordpress-api, wordpress
Wordpress
Docker based Wordpress deployment using a collection of optimized containers w/ Nginx, PHP-FPM, MariaDB and Redis.
Stars: ✭ 44 (-21.43%)
Mutual labels:  wordpress, wordpress-plugin
Cloud Blocks
WP plugin for Gutenberg Cloud – Your library of blocks in the cloud!
Stars: ✭ 44 (-21.43%)
Mutual labels:  wordpress, wordpress-plugin
Geodirectory
GeoDirectory is the fastest growing Directory plugin for WordPress. Feel free to contribute or suggest new developments and help us take GD to the next level. http://wpgeodirectory.com | http://wordpress.org/plugins/geodirectory/
Stars: ✭ 41 (-26.79%)
Mutual labels:  wordpress, wordpress-plugin
Osen Wc Mpesa
WordPress Plugin that extends WordPress and WooCommerce functionality to integrate MPESA for making payments, remittances, checking account balance transaction status and reversals.
Stars: ✭ 45 (-19.64%)
Mutual labels:  wordpress, wordpress-plugin
Wp Phpmailer
Provides a clean and simple way to configure the WordPress-bundled PHPMailer library, allowing you to quickly get started sending mail through a local or cloud based service of your choice
Stars: ✭ 46 (-17.86%)
Mutual labels:  wordpress, wordpress-plugin
Performance Improvements For Woocommerce
Performance tweaks for the front-end and back-end of a store.
Stars: ✭ 46 (-17.86%)
Mutual labels:  wordpress, wordpress-plugin
Meta Box
The best plugin for WordPress custom fields and custom meta boxes
Stars: ✭ 1,039 (+1755.36%)
Mutual labels:  wordpress, wordpress-plugin
Woosidebars
Replace registered sidebars in your WordPress themes using different conditions such as a specific page, a category or even an individual blog post.
Stars: ✭ 47 (-16.07%)
Mutual labels:  wordpress, wordpress-plugin
Elasticpress
A fast and flexible search and query engine for WordPress.
Stars: ✭ 1,037 (+1751.79%)
Mutual labels:  wordpress, wordpress-plugin

better-rest-endpoints

A WordPress plugin that serves up slimmer WP Rest API endpoints.

Endpoints

Posts

better-rest-endpoints/v1/posts Gets a collection of posts. Accepts the following parameters:

  • acf (boolean - setting to false omits acf from being returned)
  • author (string) limit posts by author nice name (user_nicename)
  • category id (int)
  • category_name (string)
  • exclude_categories (string) comma-separated array of category IDs
  • content (boolean) set to false to omit content from showing in JSON response
  • exclude (int) a post ID to exclude from the response
  • media (boolean - setting to false omits media (featured media) from being returned)
  • order (string - 'ASC' vs 'DESC')
  • orderby (string)
  • page (int)
  • per_page (int)
  • tag id (int)
  • exclude_tags (string) comma-separated array of tag IDs
  • yoast (boolean - setting to false omits yoast from being returned)

It returns a JSON response with the following:

  • ACF fields, if applicable
  • all possible thumbnail sizes & URL
  • Author, user_nicename, & Author ID
  • Categories
  • Category IDs
  • content
  • date (ISO 8601)
  • excerpt
  • id
  • slug
  • Tag IDs
  • Tags
  • title
  • Yoast SEO fields, if applicable

Post

better-rest-endpoints/v1/post/{id} Get a post by ID.

Accepts the following parameters:

  • ID (int)

Returns a JSON response with the following:

  • ACF fields, if applicable
  • all possible thumbnail sizes & URLs
  • Author, user_nicename, & Author ID
  • Categories
  • Category IDs
  • content
  • date (ISO 8601)
  • excerpt
  • id
  • slug
  • Tag IDs
  • Tags
  • title
  • Yoast SEO fields, if applicable

Post by slug

better-rest-endpoints/v1/post/{slug} Get a post by ID.

Accepts the following parameters:

  • slug (string)

Returns a JSON response with the following:

  • ACF fields, if applicable
  • all possible thumbnail sizes & URLs
  • Author, user_nicename, & Author ID
  • Categories
  • Category IDs
  • content
  • date (ISO 8601)
  • excerpt
  • id
  • slug
  • Tag IDs
  • Tags
  • title
  • Yoast SEO fields, if applicable

Pages

better-rest-endpoints/v1/pages Gets a collection of pages. Accepts the following parameters:

  • acf (boolean - setting to false omits acf from being returned)
  • content (boolean - setting to false hides the content from the response)
  • exclude (int)
  • exclude (int) a post ID to exclude from the response
  • media (boolean - setting to false omits media (featured media) from being returned)
  • order (string - 'ASC' vs 'DESC')
  • orderby (string)
  • page (int)
  • per_page (int)
  • yoast (boolean - setting to false omits yoast from being returned)

Returns the following JSON Response:

  • ACF Fields
  • all possible thumbnail sizes & URLs
  • Content
  • ID
  • Slug
  • Template Name
  • Title
  • Yoast SEO Fields

Page by ID

better-rest-endpoints/v1/page/{id} Get a page by ID.

Accepts the following parameters:

  • ID (int)

Returns a JSON response with the following:

  • ACF fields, if applicable
  • all possible thumbnail sizes & URLs
  • content
  • id
  • slug
  • template name
  • title
  • Yoast SEO fields, if applicable

Post by slug

better-rest-endpoints/v1/page/{slug|path} Get a page by slug or path. Requesting a page by slug will only return a page with no parent with the requested slug. If multiple pages have the same slug the page needs to be requested by passing the entire path. eg. better-rest-endpoints/v1/page/technology/about or better-rest-endpoints/v1/page/services/about instead of just better-rest-endpoints/v1/page/about

Accepts the following parameters:

  • slug, path (string)

Returns a JSON response with the following:

  • ACF fields, if applicable
  • all possible thumbnail sizes & URLs
  • Author, user_nicename, & Author ID
  • Categories
  • Category IDs
  • content
  • date (ISO 8601)
  • excerpt
  • id
  • slug
  • Tag IDs
  • Tags
  • title
  • Yoast SEO fields, if applicable

Custom Post Type Collection

better-rest-endpoints/v1/{custom_post_type} Gets a collection of posts from a custom post type. Accepts the following parameters:

  • acf (boolean - setting to false omits acf from being returned)
  • content (boolean - setting to false omits the_content from being returned)
  • exclude (int) a post ID to exclude from the response
  • media (boolean - setting to false omits media (featured media) from being returned)
  • orderby (string) - see the codex for options, currently does not support multiple values
  • page (int)
  • per_page (int)
  • yoast (boolean - setting to false omits yoast from being returned)

Returns the following JSON response:

  • ACF fields if applicable
  • all possible thumbnail sizes & URLs
  • Author, user_nicename, & Author ID
  • content
  • date (ISO 8601)
  • excerpt
  • ID
  • post terms
  • slug
  • title
  • Yoast SEO fields if applicable

Custom Post Type Post by ID

better-rest-endpoints/v1/{custom_post_type}/{id} Gets a single custom post type item. Accepts the following parameters:

  • ID

Returns the following JSON Response:

  • ACF Fields, if applicable
  • all possible thumbnail sizes & URLs
  • Author, user_nicename, & Author ID
  • content
  • date (ISO 8601)
  • excerpt
  • ID
  • post terms
  • slug
  • title
  • Yoast SEO Fields, if applicable

Custom Post Type Post by Slug

better-rest-endpoints/v1/{custom_post_type}/{slug} Gets a single custom post type item. Accepts the following parameters:

  • slug

Returns the following JSON Response:

  • ACF Fields, if applicable
  • all possible thumbnail sizes & URLs
  • Author, user_nicename, & Author ID
  • content
  • date (ISO 8601)
  • excerpt
  • ID
  • post terms
  • slug
  • title
  • Yoast SEO Fields, if applicable

Get Posts Belonging To A Taxonomy Term

better-rest-endpoints/v1/{taxonomy}/{term} Gets posts from a taxonomy term. Accepts the following parameters:

  • acf (boolean - setting to false omits acf from being returned)
  • content (boolean - setting to false omits the_content from being returned)
  • exclude (int) a post ID to exclude from the response
  • media (boolean - setting to false omits media (featured media) from being returned)
  • orderby (string) - see the codex for options, currently does not support multiple values
  • page (int)
  • per_page (int)
  • yoast (boolean - setting to false omits yoast from being returned)

Returns the following JSON Response:

  • ACF Fields, if applicable
  • all possible thumbnail sizes & URLs
  • Author, user_nicename, & Author ID
  • content
  • date (ISO 8601)
  • excerpt
  • ID
  • post terms
  • slug
  • title
  • Yoast SEO Fields, if applicable

Menus from slug (name)

better-rest-endpoints/v1/menus/{menu-slug} Gets a WordPress Menu by slug. Accepts no parameters.

Returns the following JSON Response in each item object:

  • classes (array)
  • description
  • ID
  • menu item parent
  • menu_order
  • slug
  • target
  • title
  • url

Menus from location (theme location)

better-rest-endpoints/v1/menus/{menu-slug} Gets a WordPress Menu by the theme location. Accepts no parameters.

Returns an empty array if the location can not be found or if it has no assigned menu. Returns an array of the following objects if a menu is assigned to the specified location:

  • classes (array)
  • description
  • ID
  • menu item parent
  • menu_order
  • slug
  • target
  • title
  • url

Taxonomies

better-rest-endpoints/v1/taxonomies Gets a list of taxonomies used by WordPress. Accepts no parameters.

Returns the following JSON response in each item object:

  • Description
  • Hierarchical (true/false)
  • Name
  • Slug

Search

better-rest-endpoints/v1/search Gets a collection of posts and pages based on the search parameter. Accepts the following parameters:

  • acf (boolean - setting to false omits acf from being returned)
  • category id (int)
  • content (boolean) set to false to omit content from showing in JSON response
  • media (boolean - setting to false omits media (featured media) from being returned)
  • page (int)
  • per_page (int)
  • search (string | required)
  • tag id (int)
  • exclude_tags (string) comma-separated array of tag IDs
  • exclude_categories (string) comma-separated array of category IDs
  • yoast (boolean - setting to false omits yoast from being returned)

It returns a JSON response with the following (returns an empty array if no posts found):

  • ACF fields, if applicable
  • all possible thumbnail sizes & URL
  • Author, user_nicename, & Author ID
  • Categories
  • Category IDs
  • content
  • date (ISO 8601)
  • excerpt
  • id
  • slug
  • Tag IDs
  • Tags
  • title
  • Yoast SEO fields, if applicable

ACF Options

better-rest-endpoints/v1/options/acf Gets an array of all ACF Options Page fields, returns an empty array if none are found or if ACF is not active.

better-rest-endpoints/v1/options/acf/{field} Gets a single ACF Options Page field, returns null if ACF is not active or the field does not exist.

Accepts the following parameters:

  • field (string - can be either the field key or the field name)

Hooks and Filters

Filter the Custom Post Types endpoints

add_filter('better_rest_endpoints_cpt_collection', function($cpt_collection){
	$cpt_collection = array_flip($cpt_collection);
	unset($cpt_collection['oembed_cache']);
	unset($cpt_collection['_pods_template']);
	unset($cpt_collection['_pods_pod']);
	unset($cpt_collection['_pods_field']);
	$cpt_collection = array_values( array_flip($cpt_collection) );
	return $cpt_collection;
});
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].