Skip to main content
Documentation/Developers/APIs/Hooks Reference/Lifecycle
Developers

Lifecycle

When Oxygen loads and when it's activated.

Startup

oxygen_loaded

Action. Oxygen has finished loading and its APIs are available. The right place to register
dynamic data fields, API keys, form actions and the like.

add_action('oxygen_loaded', function () {
    BreakdanceAPIKeysregisterKey(['name' => 'My Key', 'slug' => 'my_key']);
});

oxygen_activated

Action. The plugin was just activated. The place to seed options or schedule anything your
extension needs on a fresh install.

add_action('oxygen_activated', function () {
    add_option('my_plugin_oxygen_defaults', ['auto_purge' => true]);

    if (!wp_next_scheduled('my_plugin_nightly_sync')) {
        wp_schedule_event(time(), 'daily', 'my_plugin_nightly_sync');
    }
});

oxygen_register_template_types_and_conditions

Action. The point at which template types and conditions must be registered. This is the
hook the Conditions API tells you to use.