Skip to content
Permalink
master
Go to file
 
 
Cannot retrieve contributors at this time
27 lines (19 sloc) 3.12 KB

Extending EE4 REST API in add-ons

This article is about how EE4 Add-ons (specialized WordPress plugins) can extend the EE4 REST API in Event Espresso 4 core, but it also applies to the deprecated EE4 JSON REST API add-on. If you are looking to instead create an application that utilizes EE4 data over HTTP, please see our "Related Articles" section at the bottom of this page.

Adding Addon Data automatically to the API

The EE4 REST API is built primarily around EE4 Core components: EE_Config, EE4 models, EE4 capabilities (tentatively: EE4 messages and Single Page Checkout). If you register your addon like shown in our Example Skeleton Addon, much of your data is already available via the EE4 REST API. Specifically,

Adding Extra Endpoints

If you want to add other endpoints as part of your add-on, feel free to register hooks into WP's normal system for creating new endpoints. We have nothing against this! We just suggest organizing the hooks into an EE_Module to keep them organized together, and make sure they're not initialized too early (take a look at the Example Skeleton Addon for an example of an EE4 module, or look at them in EE4 core: they're all located in event-espresso-core/modules).

Related Articles

You can’t perform that action at this time.