Framework core hooks
Lifecycle, boot, and cross-cutting hooks fired by the framework core (the fw() runtime, the bootstrap, the dynamic-content and CSS pipelines). These are the hooks you reach for when you need to run code at a specific point in the framework's load, or to alter framework-wide behavior.
The single most useful one is fw_init — it fires once the framework is fully loaded and every component (fw()->extensions, fw()->theme, fw()->backend) is safe to touch:
add_action( 'fw_init', function () {
// Safe to call any fw() API here.
$value = fw_get_db_settings_option( 'some_option' );
} );
The boot order is fw_before_init → fw_extensions_before_init → fw_extensions_init → fw_init; see How the framework boots for the full sequence.
Actions (21)
| Hook | Passes to your callback | What it does |
|---|---|---|
fw_after_plugin_activate | — | unysonplus/unysonplus.php |
fw_automatic_update_complete | $plugin->result | unysonplus/unysonplus.php |
fw_before_init | — | unysonplus/framework/bootstrap.php |
fw_customizer_options_update | see source | (@since 2.6.0) |
fw_form_display_errors_frontend | $form | Use this action to customize errors display in your theme |
fw_form_display:after | $this | unysonplus/framework/helpers/class-fw-form.php |
fw_form_display:after_form | $this | unysonplus/framework/helpers/class-fw-form.php |
fw_form_display:before | $this | unysonplus/framework/helpers/class-fw-form.php |
fw_form_display:before_form | $this | unysonplus/framework/helpers/class-fw-form.php |
fw_init | — | The framework is loaded |
fw_plugin_activate | — | unysonplus/unysonplus.php |
fw_plugin_post_update | — | After plugin successfully updated |
fw_plugin_pre_update | — | Before plugin update The plugin was already downloaded and extracted to a temp directory and it's right before being replaced with the new downloaded version |
fw_post_options_update | see source | (@since 2.2.8) |
fw_settings_form_render | see source | unysonplus/framework/helpers/class-fw-settings-form.php |
fw_settings_form_reset | $old_values, $new_values | unysonplus/framework/helpers/class-fw-settings-form.php |
fw_settings_form_saved | $old_values, $new_values | Let the framework / theme react (cache flush, regenerated assets, etc.). |
fw_settings_options_update | see source | (@since 2.6.0) |
fw_term_options_update | see source | (@since 2.6.0) |
fw:option-storage-types:register | $register | unysonplus/framework/helpers/fw-storage.php |
fw:settings-form: | $old_values, $new_values | unysonplus/framework/helpers/class-fw-settings-form.php |
Filters (20)
| Hook | Passes to your callback | What it does |
|---|---|---|
fw_customizer_options | $this->get_options( 'customizer' ) | unysonplus/framework/core/components/theme.php |
fw_framework_customizations_dir_rel_path | '/framework-customizations' | unysonplus/framework/helpers/general.php |
fw_framework_manifest_path | fw_get_template_customizations_directory( '/theme/manifest.php' ) | unysonplus/framework/core/components/theme.php |
fw_get_db_post_option:fw-storage-enabled | see source | unysonplus/framework/helpers/database.php |
fw_google_fonts | $fonts | unysonplus/framework/helpers/general.php |
fw_option_value_error | $error, $id, $input_value, $option | Authoritative server-side custom validation: uniqueness, existence, external API checks, cross-field rules, … Registered in PHP (NOT in the option array) so it can't be tampered with via the modal save payload. Return a non-empty string to mark the field invalid, or the unchan... |
fw_plugin_action_list | $actions | unysonplus/unysonplus.php |
fw_post_options:$post_type | $this->get_options( 'posts/' . $post_type ) | unysonplus/framework/core/components/theme.php |
fw_settings_form_reset:values | array(), $old_values | unysonplus/framework/helpers/class-fw-settings-form.php |
fw_settings_form_texts | see source | unysonplus/framework/helpers/class-fw-settings-form.php |
fw_settings_options | $this->get_options( 'settings' ) | unysonplus/framework/core/components/theme.php |
fw_taxonomy_options:$taxonomy | $this->get_options( 'taxonomies/' . $taxonomy ) | unysonplus/framework/core/components/theme.php |
fw_theme_config | $config | Filter the resolved theme config after the theme's own config.php (and child-theme override) have been merged in. Lets plugins set framework-level defaults like settings_form_side_tabs on generic themes that don't ship their own theme/config.php. Filter runs once per request... |
fw_use_sessions | true | unysonplus/framework/helpers/class-fw-session.php |
fw:backend-option-view:design-default:desc-under-label | false | Fixes https://github.com/ThemeFuse/Unyson/issues/2143 (@since 2.6.9) |
fw:backend-option-view:design-default:responsive-classes | see source | unysonplus/framework/views/backend-option-design-default.php |
fw:dynamic-content:permalink_choices_limit | 200 | Max items listed per post type (keeps a huge type from making a giant dropdown). Filterable for sites that want more / fewer. |
fw:dynamic-content:tags | array() | Register Dynamic Content tags. @param array $tags Keyed by tag id. Each value is an array: 'label' => (string) label shown in the picker 'group' => (string) picker group heading 'params' => (array) optional param descriptors, each: array('id'=>'key','label'=>'Fiel... |
fw:form:nonce-name-data | '', $this, $render_data | unysonplus/framework/helpers/class-fw-form.php |
fw:options-default-values:skip-types | see source | unysonplus/framework/helpers/class-fw-db-options-model.php |