Skip to content

Creating a Custom Connector

fjarrett edited this page Sep 4, 2014 · 13 revisions

Introduction

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:

  1. Connector name/slug
  2. Connector labels
  3. Context labels
  4. Actions labels
  5. Callback functions

Understanding Contexts

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