-
Notifications
You must be signed in to change notification settings - Fork 116
Creating a Custom Connector
Connectors are the mechanism by which Stream logs activity that's happening in WordPress.
Connectors are really just a simple way to encapsulate the instructions Stream needs to monitor actions taken by specific WordPress components, like Posts, as well as actions by specific plugins, like Jetpack.
A Connector is comprised of five main components:
- Connector name/slug
- Connector labels
- Context labels
- Actions labels
- Callback functions
A Connector should be thought of as a top-level Context, and Contexts listed within our Connector as second-level Contexts.
These second-level Contexts help to further categorize actions that are happening within the Connector we are tracking.
For example, if there is a custom post type called "Books" and there is a book post called "Moby Dick" that is updated, the Stream record would look like this:
Summary: "Moby Dick" book updated
Contexts: Posts > Books
Action: Updated