forked from betterangels/better-angels
-
Notifications
You must be signed in to change notification settings - Fork 0
Buoy code structure
Meitar Moscovitz edited this page May 7, 2016
·
1 revision
Wiki ▸ Projects ▸ Buoy ▸ Developer Documentation ▸ Code structure
The code for the Buoy plugin for WordPress follows some basic organization principles. This page provides an at-a-glance overview of these general principles. For more detailed information, consult the generated API documentation.
Each major component of Buoy is defined in its own class. Each class has its own file named with class-
and the lowercased dash-separated class name.
There are at least four major components:
- Buoy User
- Buoy Team
- Buoy Alert
- Buoy Notification
Each of these inherit from a base "Buoy Plugin" (WP_Buoy_Plugin
, for the WordPress plugin) class.
The methods within each class follow a general naming convention:
-
register*
: these functions use the WordPress Plugin API to hook into the various parts of the underlying WordPress framework. -
render*
: these functions output HTML and are used to render various parts of the interface, and generally include a file from the plugin'spages/
subdirectory. -
handle*
: these functions respond to variouswp_ajax_*
or WP-API requests from a Buoy front-end client.