*/ // 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); });