Docs / Developers

Developer overview

Craftor is built to be extended from your own plugin or theme.

Every widget and every workflow automation ships from the exact same base classes and registries Craftor's own built-in ones use — there's no separate, restricted "public API" surface. If you can read one of Craftor's own widget or action classes, you can write your own.

  • Widgets extend Craftor\Widgets\AbstractWidget and register on the craftor/register_widgets hook.
  • Automation actions extend Craftor\Workflows\Actions\AbstractAction and register on the craftor/register_workflow_actions hook.
  • Lifecycle hooks (form submission, email sending, workflow execution) let you react to or adjust behavior without writing a full widget or action.

Requirements: PHP 8.2+ (matching Craftor itself) and a normal WordPress plugin (or theme functions.php) that loads after Craftor — the examples on the following pages check class_exists() before doing anything, so load order beyond "after Craftor" doesn't matter.

A complete, working example combining a custom widget, a custom action, and two lifecycle hooks ships inside the Craftor plugin's own examples/craftor-hello-addon folder — see "The example add-on plugin" for a walkthrough.