| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- /**
- * Craft in America Custom Endpoints Plugin
- *
- * @since 1.0.0
- * @package cia_endpoints
- *
- * @wordpress-plugin
- * Plugin Name: Craft in America - API Endpoints
- * Plugin URI:
- * Description: The test plugin that adds rest functionality
- * Version: 1.0.0
- * Author: TOJ <john@yvvas.com>
- */
-
- // If this file is called directly, abort.
- if ( ! defined( 'WPINC' ) ) { die; }
-
- require_once('includes/class.make-endpoint.php');
-
- /**
- * The standard wordpress post_types
- */
- add_action( 'rest_api_init', function () {
- $post_controller = new Make_Endpoint_For('post');
- $post_controller->register_routes('posts', true);
- });
- add_action( 'rest_api_init', function () {
- $page_controller = new Make_Endpoint_For('page');
- $page_controller->register_routes('pages', true);
- });
- add_action( 'rest_api_init', function () {
- $media_controller = new Make_Endpoint_For('media');
- $media_controller->register_routes('media', false);
- });
-
- /**
- * Craft in America custom post_types
- */
- add_action( 'rest_api_init', function () {
- $media_controller = new Make_Endpoint_For('customtype');
- $media_controller->register_routes('custometypes', false);
- });
|