Lifecycle
Register lifecycle callbacks in your extension plugin.
APIs Loaded
breakdance_loaded is an action without arguments:
PHP
add_action('breakdance_loaded', function () {
BreakdanceAPIKeysregisterKey([
'name' => 'Acme Service',
'slug' => 'acme_service'
]);
});
This registers a field, not its credential. Element Studio locations must register before priority 10, when scanning starts.
Other Actions
breakdance_register_template_types_and_conditions— No arguments; register types/conditions. Can run repeatedly when rendering, editor, or tools request rules; avoid persistent side effects.breakdance_activated— No arguments; Breakdance activation, not your extension's installation hook.
The compatibility helper runs breakdance_ then oxygen_; register one name to avoid duplicate execution. See compatibility.
Activation Example
PHP
add_action('breakdance_activated', function () {
add_option('my_extension_defaults', ['enabled' => true]);
});
For setup that must run when your own plugin activates, use that plugin's WordPress activation hook. breakdance_loaded runs on ordinary requests after Breakdance has loaded its APIs.