Skip to main content

Module Development

The Flavor Starter Theme uses a modular architecture that allows developers to create, register, and distribute custom modules.

How Modules Work

Each module is a self-contained directory with:

modules/my-module/
├── module.php # Main entry point (required)
├── settings.php # Module settings (optional)
├── assets/ # CSS/JS assets (optional)
└── templates/ # PHP templates (optional)

The ModuleManager handles:

  • Module discovery and loading
  • Activation/deactivation state
  • Settings management
  • License tier gating

Module Types

Built-in Modules

Included with the theme in flavor-starter/inc/modules/. Managed by FlavorTeam.

External Modules

Registered by child themes or plugins via the flavor_register_modules action hook.

Module Lifecycle

Registration → Discovery → Activation → Initialization → Running
↘ Deactivation (dormant)
  1. Registration — Module declares itself to the ModuleManager
  2. Discovery — ModuleManager finds and catalogs available modules
  3. Activation — User enables the module (state saved in DB)
  4. Initialization — Module's init() function is called on each request
  5. Running — Module's hooks and features are active

Quick Start

Want to create a module? Head to Creating a Module.