Skip to main content
Documentation/Developers/APIs/Breakdance & Oxygen Compatibility

Breakdance & Oxygen Compatibility

Shared implementation does not imply identical registries or features. Detect mode after loading:

PHP
<?php
add_action('breakdance_loaded', function () {
    if (!defined('BREAKDANCE_MODE')) return;
    if (BREAKDANCE_MODE === 'breakdance') {
        // Register the Breakdance-specific part of your extension.
    }
});

Shared PHP namespaces such as BreakdanceElements and BreakdanceDynamicData can remain unchanged in Oxygen.

Hook Aliases

bdox_run_action() runs Breakdance then Oxygen names; bdox_run_filters() passes the Breakdance result through Oxygen filters. Registering both can execute twice.

Direct do_action()/apply_filters() calls—including inspected validation and MCP filters—do not gain aliases. Register one verified hook.

Product Differences

Area Compatibility consideration
Stored options and metadata The product's string helpers select mode-specific prefixes. Do not copy raw database keys between products without a tested migration.
Element slugs Shipping element namespaces and available element types differ. Discover the actual registry/schema instead of guessing an Oxygen equivalent.
Builder UI Panels, labels, controls, and feature availability may be mode-gated. Shared PHP does not prove the same user workflow.
MCP abilities Namespace is breakdance or oxygen; popup/maintenance tools are Breakdance-specific and component editable-property tools are Oxygen-specific.
Global Settings Breakdance supplies its settings; Oxygen availability can depend on enabled add-ons.
PHP classes Shared Breakdance... class names may remain unchanged, but a class from an optional package may not be loaded.

Global Blocks do not automatically become Components with editable properties. Defer subclasses until dependencies load and test optional packages absent as well as present on each supported product/version.

The same Feature Card extension and Heading control in Breakdance and Oxygen

Declare Element Availability

Element Studio's Available In setting writes the element's availableIn() method:

PHP
static function availableIn()
{
    return ['breakdance', 'oxygen'];
}

Return both when the element supports both products, or only the product it supports. This controls availability; it does not translate product-specific controls or element references.

For shared hooks that provide an alias, use the breakdance_ name in a cross-product extension. All callbacks on that name run before the Oxygen alias, regardless of the priorities assigned to callbacks on the other name. In particular, register Element Studio saving locations on breakdance_loaded before priority 10; waiting for oxygen_loaded misses the element scan.