Module Registration
Custom modules are registered using theFLBuilder::register_module() function and must extend the FLBuilderModule base class.
Basic Module Structure
Here’s a complete example of a simple custom module:Module Class Structure
The module class extendsFLBuilderModule and defines the module’s behavior.
Constructor Parameters
The parent constructor accepts an array of parameters:Display name for the module shown in the UI
Brief description of what the module does
Category to group the module under (e.g., ‘Basic’, ‘Advanced’)
Icon filename (SVG) or dashicon class
Absolute path to the module directory
URL to the module directory
Whether the module is enabled on the frontend
Whether module content should be exported to WP editor
Enable partial refresh for faster preview updates
Whether to include default module wrapper divs
Show container element setting in Advanced tab
Example from Beaver Builder Core
From~/workspace/source/modules/button/button.php:12:
Directory Structure
Each module should be in its own directory with the following structure:Frontend Template
Createincludes/frontend.php to define your module’s HTML output:
Dynamic CSS Template
Createincludes/frontend.css.php for settings-based styling:
Module Class Methods
TheFLBuilderModule base class provides several methods you can override:
enqueue_scripts()
Enqueue additional CSS and JavaScript files:~/workspace/source/modules/button/button.php:123:
update( $settings )
Modify settings before they are saved:filter_settings( helper )
Ensure backwards compatibility with old settings:delete()
Perform cleanup when a module is updated or deleted:remove()
Run logic when a module is actually removed from the page:Complete Example: Alert Module
Here’s a complete working example:Module Icon
You can provide a custom icon for your module:SVG File
Place anicon.svg file in your module directory:
Inline SVG
Dashicon
Advanced Features
Module Categories
Create custom categories for your modules:Container Modules
Create modules that accept child modules:Next Steps
Module Settings
Configure advanced settings forms
Hooks & Filters
Extend with WordPress hooks
Getting Started
Back to development basics