Public | Automated Build

Last pushed: 2 years ago
Short Description
Full Description



Post Types

To add new post types or taxonomies, Simply copy ( or modify ) lib/Post/Type/ExamplePostType.php :

  • The new post type must extend Carbonite\Post\PostType and implement Carbonite\Post\PostTypeInterface.
  • It should have register() in your class as public function.
  • Create one post type per class, it can have many taxonomies but you should keep it at one post type per class.
  • Register your post type in lib\Post\Register.php

REST Routes & Actions

Since 4.4 WP introduced RESTFul API which makes it super easy to create frontend javascript application, With this new API you can use Angular, Vue.js or any other
JS framework to build frontend application while retrieving data from WP Core.

The REST API endpoint is

First of all you need to define a namespace for your theme or plugin, Do this by opening lib/REST/REST.php and modifying REST_NAMESPACE constant at top of the class.

This will register following namespace for your ajax and JSONP requests :

To add new Routes and actions, Simply copy ( or modify ) lib/REST/Action/ExampleAction.php :

  • Your class must extend Carbonite\REST\REST and implement Carbonite\REST\RESTActionInterface.
  • It should have register() in your class as public function.
  • Register your routes and actions in register() method using $this->registerRoute() function, It accepts route name and options,
    For complete list of options visit :
  • Try to separate actions by domain logic
  • Register your action in lib/REST/Register.php
Docker Pull Command
Source Repository