Add dynamic tag
Scope: External — the full documented outcome is shippable from a 3rd-party plugin via
elementor/dynamic_tags/registerand the atomic select-control filters; no Core changes required. There is no public filter for category→schema auto-mapping — custom mapping needs manual prop unions. Full split + disclaimer: skills-scope.md.
Implementation location
- PHP: existing or new third-party plugin repository; plugin-owned
Tagsubclasses and registration (e.g.MyPlugin\Tags\). - Do not modify Elementor Core. Bridge internals live in
modules/atomic-widgets/dynamic-tags/— reference only. - Runnable reference: examples/example-plugin/ (
Site_Name_Tagwith group, controls, render).
Prerequisites
- Experiment
e_atomic_elementsactive — see getting-started/experiments.md.
Read first: dynamic-tags/extending.md. Supporting: overview.md, binding-propvalues.md, discovery.md.
Checklist
- Register legacy v3 tag (required bridge entry point)
add_action( 'elementor/dynamic_tags/register', function ( $manager ) {
$manager->register( new \MyPlugin\Tags\Store_Hours() );
} );
- Tag class — extend
\Elementor\Core\DynamicTags\Tag;get_name(),get_title(),get_group(),get_categories()using\Elementor\Modules\DynamicTags\Module::TEXT_CATEGORY,URL_CATEGORY, etc.register_controls()is required when the tag has per-tag settings in the atomic editor. Controltype: prefer plain strings ('text','select') as in docs;\Elementor\Controls_Manager::TEXTetc. are equivalent (includes/managers/controls.php). Implementrender(). Convertible controls:text,textarea,select,number,switcher,choose,query,date_time,media. Example: docs/atomic-builder/examples/add-dynamic-tag.md. - Optional group —
Plugin::$instance->dynamic_tags->register_group( 'my-plugin', [ 'title' => 'My Plugin' ] ). - Core auto-mapping (no plugin work) — For standard tags (e.g.
TEXT_CATEGORYon a plain string prop), Core'sDynamic_Prop_Types_Mappinghookselementor/atomic-widgets/props-schemaandelementor/atomic-widgets/styles/schemainternally (dynamic-tags-module.php) — plugins do not register these hooks. Plugin action is only needed for custom/non-standard prop types (step 6). - Non-convertible controls — override
get_editor_config()withforce_convert_to_atomic => true(unsupported controls skipped, not whole tag). - Custom prop type — add
Dynamic_Prop_Type::make()->categories( [ … ] )to the union manually; narrow with->allowed_tag_names(); opt out with->meta( Dynamic_Prop_Type::ignore() ). - Dynamic select options — filters:
elementor/atomic/dynamic-tags/select_control_options— flatoptionson select controlselementor/atomic/dynamic-tags/select_control_groups— same signature; for select controls that usegroups(not flatoptions)
- Verify
- Tag discoverable via editor
atomicDynamicTagsand MCP/RESTlist-dynamic-tags— discovery.md. - Binding saves as
$$type: dynamicwithname,group,settings. - Render/import/export: Core registers
Dynamic_TransformerandImportExport\Dynamic_Transformeron transformer hooks — plugins do not register these; only register the legacyTag(and optional manual prop unions).
- Tag discoverable via editor
External implementation path
- Plugin owns
Tagsubclass +elementor/dynamic_tags/register. - Custom atomic prop unions in own prop types — no public filter for category→schema mapping.
- Select option filters for dynamic picker UX.
Core reference paths (do not edit)
- Bridge:
modules/atomic-widgets/dynamic-tags/(Dynamic_Prop_Types_Mapping,Dynamic_Tags_Converter,Dynamic_Transformer).
See also
- create-atomic-widget — define props that accept dynamic bindings
- fundamentals/transformers.md —
Dynamic_Transformer