Skip to content

Commit

Permalink
Rename all instances of better-wp-endpoints to better-rest-endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
erwstout committed Jan 11, 2018
1 parent 3c795ef commit 48d4c99
Show file tree
Hide file tree
Showing 16 changed files with 31 additions and 31 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# better-wp-endpoints
# better-rest-endpoints
A WordPress plugin that serves up slimmer WP Rest API endpoints - WIP

## Endpoints

### Posts
**`better-wp-endpoints/v1/posts`**
**`better-rest-endpoints/v1/posts`**
Gets a collection of posts. Accepts the following parameters:

- page (int)
Expand Down Expand Up @@ -34,7 +34,7 @@ It returns a JSON response with the following:
- ACF fields, if applicable

### Post
**`better-wp-endpoints/v1/post/{id}`**
**`better-rest-endpoints/v1/post/{id}`**
Get a post by ID.

Accepts the following parameters:
Expand All @@ -58,7 +58,7 @@ Returns a JSON response with the following:
- ACF fields, if applicable

### Pages
**`better-wp-endpoints/v1/pages`**
**`better-rest-endpoints/v1/pages`**
Gets a collection of pages. Accepts the following parameters:

- exclude (int)
Expand All @@ -80,7 +80,7 @@ Returns the following JSON Response:
- all possible thumbnail sizes & URLs

### Page by ID
**`better-wp-endpoints/v1/page/{id}`**
**`better-rest-endpoints/v1/page/{id}`**
Get a page by ID.

Accepts the following parameters:
Expand All @@ -98,7 +98,7 @@ Returns a JSON response with the following:
- ACF fields, if applicable

### Custom Post Type Collection
**`better-wp-endpoints/v1/{custom_post_type}`**
**`better-rest-endpoints/v1/{custom_post_type}`**
Gets a collection of posts from a custom post type. Accepts the following parameters:

- per_page (int)
Expand All @@ -121,7 +121,7 @@ Returns the following JSON response:
- ACF fields if applicable

### Custom Post Type Post by ID
**`better-wp-endpoints/v1/{custom_post_type}/{id}`**
**`better-rest-endpoints/v1/{custom_post_type}/{id}`**
Gets a single custom post type item. Accepts the following parameters:

- ID
Expand All @@ -140,7 +140,7 @@ Returns the following JSON Response:
- ACF Fields, if applicable

### Custom Post Type Post by Slug
**`better-wp-endpoints/v1/{custom_post_type}/{slug}`**
**`better-rest-endpoints/v1/{custom_post_type}/{slug}`**
Gets a single custom post type item. Accepts the following parameters:

- slug
Expand All @@ -159,7 +159,7 @@ Returns the following JSON Response:
- ACF Fields, if applicable

### Get Posts Belonging To A Taxonomy Term
**`better-wp-endpoints/v1/{taxonomy}/{term}`**
**`better-rest-endpoints/v1/{taxonomy}/{term}`**
Gets posts from a taxonomy term. Accepts the following parameters:

- per_page (int)
Expand All @@ -182,7 +182,7 @@ Returns the following JSON Response:
- ACF Fields, if applicable

### Menus
**`better-wp-endpoints/v1/menus/{menu-slug}`**
**`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:
Expand All @@ -198,7 +198,7 @@ Returns the following JSON Response in each item object:
- menu item parent

### Taxonomies
**`better-wp-endpoints/v1/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:
Expand All @@ -209,7 +209,7 @@ Returns the following JSON response in each item object:
- Hierarchical (true/false)

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

- page (int)
Expand Down
4 changes: 2 additions & 2 deletions better-wp-endpoints.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php
/*
Plugin Name: Better Rest Endpoints
Plugin URI: https://github.com/factor1/better-wp-endpoints/
Plugin URI: https://github.com/factor1/better-rest-endpoints/
Description: Serves up slimmer WordPress Rest API endpoints, with some great enhancements.
Version: 0.2.0
Author: Eric Stout, Factor1 Studios
Author URI: https://factor1studios.com/
License: GPL3
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Text Domain: better-wp-endpoints
Text Domain: better-rest-endpoints
Domain Path: /languages
Better Rest Endpoints is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion copy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const fs = require('fs-extra'),
target = '/Users/ericstout/Documents/projects/better-wp-endpoints-wp/app/public/wp-content/plugins/better-wp-endpoints',
target = '/Users/ericstout/Documents/projects/better-rest-endpoints-wp/app/public/wp-content/plugins/better-rest-endpoints',
files = './';

fs.copy(files, target)
Expand Down
2 changes: 1 addition & 1 deletion includes/create_cpt_endpoints.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function bwe_build_cpt_endpoints() {
*
*/

register_rest_route( 'better-wp-endpoints/v1', '/'.$cpt.'/', array(
register_rest_route( 'better-rest-endpoints/v1', '/'.$cpt.'/', array(
'methods' => 'GET',
'callback' => function ( WP_REST_Request $request ) use($cpt) {

Expand Down
2 changes: 1 addition & 1 deletion includes/get_cpt_by_id.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function bwe_build_single_cpt_endpoints() {
* Register Rest API Endpoint
*
*/
register_rest_route( 'better-wp-endpoints/v1', '/'.$cpt.'/(?P<id>\d+)', array(
register_rest_route( 'better-rest-endpoints/v1', '/'.$cpt.'/(?P<id>\d+)', array(
'methods' => 'GET',
'callback' => function ( WP_REST_Request $request ) use ($cpt) {

Expand Down
2 changes: 1 addition & 1 deletion includes/get_cpt_by_slug.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function bwe_build_single_cpt_endpoints_slug() {
* Register Rest API Endpoint
*
*/
register_rest_route( 'better-wp-endpoints/v1', '/'.$cpt.'/(?P<slug>\S+)', array(
register_rest_route( 'better-rest-endpoints/v1', '/'.$cpt.'/(?P<slug>\S+)', array(
'methods' => 'GET',
'callback' => function ( WP_REST_Request $request ) use ($cpt) {

Expand Down
2 changes: 1 addition & 1 deletion includes/get_page_by_id.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function get_page_by_id( WP_REST_Request $request ){
}

add_action( 'rest_api_init', function () {
register_rest_route( 'better-wp-endpoints/v1', '/page/(?P<id>\d+)', array(
register_rest_route( 'better-rest-endpoints/v1', '/page/(?P<id>\d+)', array(
'methods' => 'GET',
'callback' => 'get_page_by_id',
) );
Expand Down
2 changes: 1 addition & 1 deletion includes/get_pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function bwe_get_pages( WP_REST_Request $request ) {
*
*/
add_action( 'rest_api_init', function () {
register_rest_route( 'better-wp-endpoints/v1', '/pages/', array(
register_rest_route( 'better-rest-endpoints/v1', '/pages/', array(
'methods' => 'GET',
'callback' => 'bwe_get_pages',
'args' => array(
Expand Down
2 changes: 1 addition & 1 deletion includes/get_post_by_id.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function get_post_by_id( $data ) {
}

add_action( 'rest_api_init', function () {
register_rest_route( 'better-wp-endpoints/v1', '/post/(?P<id>\d+)', array(
register_rest_route( 'better-rest-endpoints/v1', '/post/(?P<id>\d+)', array(
'methods' => 'GET',
'callback' => 'get_post_by_id',
) );
Expand Down
2 changes: 1 addition & 1 deletion includes/get_posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function bwe_get_posts( WP_REST_Request $request ) {
*
*/
add_action( 'rest_api_init', function () {
register_rest_route( 'better-wp-endpoints/v1', '/posts/', array(
register_rest_route( 'better-rest-endpoints/v1', '/posts/', array(
'methods' => 'GET',
'callback' => 'bwe_get_posts',
'args' => array(
Expand Down
2 changes: 1 addition & 1 deletion includes/get_posts_tax.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function bwe_build_custom_tax_endpoint() {
* Register Rest API Endpoint
*
*/
register_rest_route( 'better-wp-endpoints/v1', '/'.$tax.'/'.$tax_term->slug.'/', array(
register_rest_route( 'better-rest-endpoints/v1', '/'.$tax.'/'.$tax_term->slug.'/', array(
'methods' => 'GET',
'callback' => function ( WP_REST_Request $request ) use ($tax, $tax_term) {

Expand Down
2 changes: 1 addition & 1 deletion includes/get_search.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function bwe_get_search( WP_REST_Request $request ) {
*
*/
add_action( 'rest_api_init', function () {
register_rest_route( 'better-wp-endpoints/v1', '/search/', array(
register_rest_route( 'better-rest-endpoints/v1', '/search/', array(
'methods' => 'GET',
'callback' => 'bwe_get_search',
'args' => array(
Expand Down
2 changes: 1 addition & 1 deletion includes/get_taxonomies.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function bwe_get_taxonomies() {
*
*/

register_rest_route( 'better-wp-endpoints/v1', '/taxonomies/', array(
register_rest_route( 'better-rest-endpoints/v1', '/taxonomies/', array(
'methods' => 'GET',
'callback' => function ( WP_REST_Request $request ) use($bwe_taxonomies) {
return $bwe_taxonomies;
Expand Down
2 changes: 1 addition & 1 deletion includes/wp_nav_menus.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function bwe_get_menus() {
*
*/

register_rest_route( 'better-wp-endpoints/v1', '/menus/'.$menu->slug.'/', array(
register_rest_route( 'better-rest-endpoints/v1', '/menus/'.$menu->slug.'/', array(
'methods' => 'GET',
'callback' => function ( WP_REST_Request $request ) use($slim_menu_items) {
return $slim_menu_items;
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "better-wp-endpoints",
"name": "better-rest-endpoints",
"version": "0.2.0",
"description": "Serves up slimmer WordPress Rest API endpoints.",
"main": "index.js",
Expand All @@ -9,7 +9,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/factor1/better-wp-endpoints.git"
"url": "git+https://github.com/factor1/better-rest-endpoints.git"
},
"keywords": [
"WordPress",
Expand All @@ -24,9 +24,9 @@
"author": "Eric Stout",
"license": "GPL-3.0",
"bugs": {
"url": "https://github.com/factor1/better-wp-endpoints/issues"
"url": "https://github.com/factor1/better-rest-endpoints/issues"
},
"homepage": "https://github.com/factor1/better-wp-endpoints#readme",
"homepage": "https://github.com/factor1/better-rest-endpoints#readme",
"devDependencies": {
"fs-extra": "^4.0.2"
}
Expand Down

0 comments on commit 48d4c99

Please sign in to comment.