Skip to main content

Options & backend hooks

Hooks around the options framework and the WordPress backend: registering Theme Settings / Customizer / post / taxonomy option arrays, the option-type and container-type rendering pipeline, option storage, and the admin enqueue points.

Registering a new Theme Settings tab is the canonical example:

add_filter( 'fw_settings_options', function ( $options ) {
$options['my_tab'] = array(
'type' => 'tab',
'title' => __( 'My Tab', 'my-domain' ),
'options' => array(
'my_field' => array( 'type' => 'text', 'label' => 'My field' ),
),
);
return $options;
} );

The same pattern applies to fw_customizer_options, fw_post_options (passed $post_type), and fw_taxonomy_options (passed $taxonomy). Read saved values back with fw_get_db_settings_option() — see Option types.

Actions (12)

HookPasses to your callbackWhat it does
fw_admin_enqueue_scripts:customizerunysonplus/framework/core/components/backend.php
fw_admin_enqueue_scripts:postget_post()unysonplus/framework/core/components/backend.php
fw_admin_enqueue_scripts:settingsunysonplus/framework/core/components/backend/class-fw-settings-form-theme.php
fw_admin_enqueue_scripts:termget_current_screen()->taxonomyunysonplus/framework/core/components/backend.php
fw_backend_add_custom_settings_menu$dataUse this action if you what to add the settings page in a custom place in menu Usage example http://pastebin.com/gvAjGRm1
fw_backend_options_render:taxonomy:afterunysonplus/framework/core/components/backend.php
fw_backend_options_render:taxonomy:beforeunysonplus/framework/core/components/backend.php
fw_container_types_initunysonplus/framework/core/components/backend.php
fw_option_types_initunysonplus/framework/core/components/backend.php
fw_save_post_options$post_id, $post, $old_values@deprecated Use the 'fw_post_options_update' action
fw_save_term_options$term_id, $taxonomy->name, []unysonplus/framework/core/components/backend.php
fw:option-type:wp-editor:enqueue-scriptsunysonplus/framework/includes/option-types/wp-editor/class-fw-option-type-wp-editor.php

Filters (17)

HookPasses to your callbackWhat it does
fw_backend_undefined_option_type_warn_usertrue, $typeunysonplus/framework/core/components/backend.php
fw_customizer_option_change_timeout333unysonplus/framework/core/components/backend.php
fw_get_settings_page_slug'fw-settings'unysonplus/framework/core/components/backend.php
fw_js_l10n$l10nfixes https://github.com/ThemeFuse/Unyson/issues/2381 (@since 2.6.14)
fw_loader_imagefw_get_framework_directory_uri() . '/static/img/logo.svg'unysonplus/framework/core/components/backend.php
fw_option_type_background_pro_color_palette$paletteunysonplus/framework/includes/option-types/background-pro/class-fw-option-type-background-pro.php
fw_option_type_icon_sets$this->get_default_sets()unysonplus/framework/includes/option-types/icon/class-fw-option-type-icon.php
fw_option_type_spacing_scale$this->default_scale()unysonplus/framework/includes/option-types/spacing/class-fw-option-type-spacing.php
fw_option_type_typography_standard_fontssee sourceunysonplus/framework/includes/option-types/typography/class-fw-option-type-typography.php
fw_option_type_typography_v2_standard_fontssee sourceunysonplus/framework/includes/option-types/typography-v2/class-fw-option-type-typography-v2.php
fw_theme_settings_menu_register$should_registerunysonplus/framework/core/components/backend/class-fw-settings-form-theme.php
fw:backend:enqueue-options-on-frontendfalseunysonplus/framework/core/components/backend.php
fw:backend:option-render:data$dataunysonplus/framework/core/components/backend.php
fw:option-modal:default:reset-btn-disabledfalse(@since 2.6.13)
fw:option-type:addable-popup:value-from-input$values, $optionFor e.g. option type 'unique' needs to execute _get_value_from_input() for each option to prevent duplicate values
fw:option-type:multi-picker:fw-storage:process-inner-optionsfalseunysonplus/framework/includes/option-types/multi-picker/class-fw-option-type-multi-picker.php
fw:option-type:multi-select:query_posts$setunysonplus/framework/includes/option-types/multi-select/class-fw-option-type-multi-select.php