Overview#
Jalpi Page Builder is architected around clean WordPress extension principles. The editor and the frontend renderer are completely decoupled: a React single-page application in wp-admin produces a JSON node tree, while an optimized PHP renderer turns that tree into semantic HTML on the frontend.
To let third-party plugins and theme developers customize this pipeline safely, Jalpi exposes a suite of verified WordPress actions and filters. By hooking into these extension points from a custom plugin or child theme's functions.php, you can:
- Register custom dynamic tags to pull bespoke post, user, or CRM fields into editor widgets.
- Override default settings (container width, breakpoints, primary colors) across new installations.
- Add custom fonts (Google Fonts, Typekit, or self-hosted files) to the visual font picker.
- Customize WooCommerce product query arguments and category terms.
- React to global class additions, updates, and deletions to invalidate external caching layers (Varnish, Redis, Cloudflare).
Actions#
Actions allow developers to execute custom code at specific lifecycle moments in Jalpi Page Builder.
| Hook | Type | When It Runs | Arguments | Purpose |
|---|---|---|---|---|
jalpi_class_saved | Action | After a global class is created or updated | array $clean | Purge CSS caches, notify CDNs, or log class updates |
jalpi_class_deleted | Action | After a global class row is deleted | string $class_key | Clean up associated cached stylesheets and metadata |
Filters#
Filters pass data through your custom functions, allowing you to modify defaults, sanitize inputs, or inject options before Jalpi processes them.
| Hook | Type | Input Value | Expected Return | Purpose |
|---|---|---|---|---|
jalpi_settings_defaults | Filter | array $defaults | array | Customize default values for all 5 settings tabs & seeded Design System tokens. |
jalpi_settings_tabs | Filter | array $tabs | array | Add, reorder, or modify tabs in the Jalpi Settings admin screen. |
jalpi_selectable_post_types | Filter | array $post_types | array | Filter which public post types are available for builder enablement. |
jalpi_internal_editor_post_types | Filter | array $types | array | Admit internal custom post types (e.g. theme templates) to the canvas editor. |
jalpi_design_system_capability | Filter | string $capability | string | Customize WordPress capability required to modify site-wide Design Tokens (default manage_options). |
jalpi_settings_font_options | Filter | array $fonts | array | Inject custom or self-hosted font families into typography pickers. |
jalpi_valid_dynamic_tags | Filter | array $tags | array | Register custom dynamic tags available in widget text/URL fields. |
jalpi_before_compile_class_css | Filter | array $styles, string $class_key | array | Filter style dictionary before generating global CSS class definitions. |
jalpi_global_css_vars | Filter | array $vars | array | Filter CSS variables emitted in :root from plugin settings. |
jalpi_design_system_css_vars | Filter | array $vars | array | Filter CSS custom property output from Design System tokens. |
jalpi_products_grid_query_args | Filter | array $args, array $settings | array | Filter WP_Query arguments in WooCommerce Products Grid widget. |
jalpi_product_categories_args | Filter | array $args, array $settings | array | Filter get_terms() arguments in Product Categories widget. |
jalpi_sanitize_general_settings | Filter | array $clean, array $input | array | General settings sanitization pipeline hook. |
jalpi_sanitize_layout_settings | Filter | array $clean, array $input | array | Layout settings sanitization pipeline hook. |
jalpi_sanitize_design_settings | Filter | array $clean, array $input | array | Design settings sanitization pipeline hook. |
jalpi_sanitize_performance_settings | Filter | array $clean, array $input | array | Performance settings sanitization pipeline hook. |
jalpi_sanitize_breakpoints_settings | Filter | array $clean, array $input | array | Breakpoints settings sanitization pipeline hook. |
Hook Reference#
jalpi_valid_dynamic_tags#
Type: Filter | Source: includes/class-jalpi-dynamic-tags.php:171
Filters the array of registered dynamic tags. Used to register custom dynamic tags that appear in the editor's dynamic data picker (e.g. for text widgets, buttons, and links).
add_filter( 'jalpi_valid_dynamic_tags', function( array $tags ): array {
$tags['user_company'] = [
'label' => __( 'User Company', 'my-plugin' ),
'group' => 'user',
'callback' => function( $post_id ) {
$user_id = get_current_user_id();
return $user_id ? get_user_meta( $user_id, 'company_name', true ) : '';
},
];
return $tags;
}, 10, 1 );jalpi_settings_defaults#
Type: Filter | Source: includes/class-jalpi-settings.php:138
Runs inside Jalpi_Settings::defaults() on reads, activation seeding, and settings registration. Allows theme authors to pre-configure defaults.
add_filter( 'jalpi_settings_defaults', function( array $defaults ): array {
// Customize default container width and primary brand color
$defaults['layout']['container_width'] = '1440px';
$defaults['design']['primary_color'] = '#4f46e5';
$defaults['performance']['enable_page_cache'] = '1';
return $defaults;
}, 10, 1 );jalpi_settings_font_options#
Type: Filter | Source: includes/class-jalpi-editor.php:293
Filters font families presented in the typography font selector inside both the visual editor and admin settings.
add_filter( 'jalpi_settings_font_options', function( array $fonts ): array {
$fonts['Cabinet Grotesk'] = 'Cabinet Grotesk, sans-serif';
$fonts['Satoshi'] = 'Satoshi, sans-serif';
return $fonts;
}, 10, 1 );jalpi_products_grid_query_args#
Type: Filter | Source: includes/class-jalpi-woo-query.php:221
Filters the WP_Query argument array used by the WooCommerce Products Grid widget before executing the query.
add_filter( 'jalpi_products_grid_query_args', function( array $args, array $settings ): array {
// Only query products currently in stock
$args['meta_query'][] = [
'key' => '_stock_status',
'value' => 'instock',
'compare' => '=',
];
return $args;
}, 10, 2 );jalpi_class_saved#
Type: Action | Source: includes/class-jalpi-class-manager.php:220, 277
Fires immediately after a global CSS class is created or updated in the {prefix}jalpi_classes database table.
add_action( 'jalpi_class_saved', function( array $clean ) {
$class_key = $clean['class_key'];
// Invalidate edge cache or rebuild compiled static CSS file
delete_transient( 'my_theme_compiled_classes' );
}, 10, 1 );jalpi_class_deleted#
Type: Action | Source: includes/class-jalpi-class-manager.php:312
Fires immediately after a global CSS class is deleted.
add_action( 'jalpi_class_deleted', function( string $class_key ) {
delete_transient( 'my_theme_compiled_classes' );
}, 10, 1 );jalpi_design_system_capability#
Type: Filter | Source: includes/class-jalpi-api.php:217
Controls the capability required to modify Design System tokens and global classes. Defaults to manage_options.
add_filter( 'jalpi_design_system_capability', function( string $cap ): string {
// Allow editors to modify design tokens
return 'edit_theme_options';
} );jalpi_global_css_vars#
Type: Filter | Source: includes/class-jalpi-settings.php:830
Filters the associative array of CSS custom properties injected into :root on the frontend.
add_filter( 'jalpi_global_css_vars', function( array $vars ): array {
$vars['--jalpi-accent-glow'] = 'rgba(99, 102, 241, 0.35)';
return $vars;
} );Filters Added With the 1.0.5 Features#
These filters belong to the Role Manager, AI Generator, Addons screen, Element Manager and contact endpoint. They are not part of the tables above.
| Filter | Value | Purpose |
|---|---|---|
jalpi_permissions_enabled | bool, default true | Return false to switch the Role Manager permission layer off, like the JALPI_PERMISSIONS_DISABLED constant. |
jalpi_ai_capability | string, default manage_options | The WordPress capability needed to use the AI Website Generator. |
jalpi_ai_hourly_limit | int | The per-user requests-per-hour limit for the AI Website Generator. |
jalpi_addons_registry | array | The list of addons shown on the Addons screen. |
jalpi_element_manager_catalog | array | The element catalog shown in the Element Manager. |
jalpi_contact_recipient | string, default the site admin email | Who receives mail from the built-in contact endpoint used by starter-site contact forms. |
Constants: JALPI_PERMISSIONS_DISABLED (see Role Manager) and JALPI_AI_API_KEY (see AI Website Generator).
Best Practices#
Development Guidelines
- Never modify Jalpi core files: Always attach your extensions using a child theme
functions.phpor dedicated extension plugin. - Specify argument counts: When using hooks with multiple parameters (e.g.
jalpi_products_grid_query_args), always pass the parameter count explicitly:add_filter( 'jalpi_products_grid_query_args', 'my_func', 10, 2 ). - Always return the value in filters: A filter must always return the filtered variable, even if no modifications were made.
- Sanitize custom inputs: Always use appropriate WordPress sanitization (
sanitize_text_field,absint,sanitize_hex_color) before saving or rendering custom data.
Last updated: November 2026