class WP_Customize_Widgets {}

Customize Widgets class.

Description

Implements widget management in the Customizer.

See also

More Information

WP_Customize_Widgets is WordPress’ class for implementing widget management via the Theme Customization API for WordPress 3.9 and newer.

This live preview and management of widgets via the Customizer serves as a secondary option to the traditional widget management workflow already in place.

WordPress instantiates the class via WP_Customize_Manager and works by adding a new Customizer section for each of the active sidebars visible in the Customizer preview.

Methods

NameDescription
WP_Customize_Widgets::__constructInitial loader.
WP_Customize_Widgets::_sort_name_callbackNaturally orders available widgets by name.
WP_Customize_Widgets::call_widget_updateFinds and invokes the widget update and control callbacks.
WP_Customize_Widgets::capture_filter_pre_get_optionPre-filters captured option values before retrieving.
WP_Customize_Widgets::capture_filter_pre_update_optionPre-filters captured option values before updating.
WP_Customize_Widgets::count_captured_optionsRetrieves the number of captured widget option updates.
WP_Customize_Widgets::customize_controls_initEnsures all widgets get loaded into the Customizer.
WP_Customize_Widgets::customize_dynamic_partial_argsFilters arguments for dynamic widget partials.
WP_Customize_Widgets::customize_preview_enqueueEnqueues scripts for the Customizer preview.
WP_Customize_Widgets::customize_preview_initAdds hooks for the Customizer preview.
WP_Customize_Widgets::customize_registerRegisters Customizer settings and controls for all sidebars and widgets.
WP_Customize_Widgets::end_dynamic_sidebarFinishes keeping track of the current sidebar being rendered.
WP_Customize_Widgets::enqueue_scriptsEnqueues scripts and styles for Customizer panel and export data to JavaScript.
WP_Customize_Widgets::export_preview_dataCommunicates the sidebars that appeared on the page at the very end of the page, and at the very end of the wp_footer,
WP_Customize_Widgets::filter_customize_dynamic_setting_argsDetermines the arguments for a dynamically-created setting.
WP_Customize_Widgets::filter_customize_value_old_sidebars_widgets_dataFilters old_sidebars_widgets_data Customizer setting.
WP_Customize_Widgets::filter_dynamic_sidebar_paramsInject selective refresh data attributes into widget container elements.
WP_Customize_Widgets::filter_option_sidebars_widgets_for_theme_switchFilters sidebars_widgets option for theme switch.
WP_Customize_Widgets::filter_sidebars_widgets_for_rendering_widgetFilters sidebars_widgets to ensure the currently-rendered widget is the only widget in the current sidebar.
WP_Customize_Widgets::filter_wp_kses_allowed_data_attributesEnsures the HTML data-* attributes for selective refresh are allowed by kses.
WP_Customize_Widgets::get_available_widgetsBuilds up an index of all available widgets for use in Backbone models.
WP_Customize_Widgets::get_captured_optionRetrieves the option that was captured from being saved.
WP_Customize_Widgets::get_captured_optionsRetrieves captured widget option updates.
WP_Customize_Widgets::get_instance_hash_keyRetrieves MAC for a serialized widget instance string.
WP_Customize_Widgets::get_post_valueRetrieves an unslashed post value or return a default.
WP_Customize_Widgets::get_selective_refreshable_widgetsList whether each registered widget can be use selective refresh.
WP_Customize_Widgets::get_setting_argsRetrieves common arguments to supply when constructing a Customizer setting.
WP_Customize_Widgets::get_setting_idConverts a widget_id into its corresponding Customizer setting ID (option name).
WP_Customize_Widgets::get_setting_typeRetrieves the widget setting type given a setting ID.
WP_Customize_Widgets::get_widget_controlRetrieves the widget control markup.
WP_Customize_Widgets::get_widget_control_partsRetrieves the widget control markup parts.
WP_Customize_Widgets::is_option_capture_ignoredDetermines whether the captured option update should be ignored.
WP_Customize_Widgets::is_panel_activeDetermines whether the widgets panel is active, based on whether there are sidebars registered.
WP_Customize_Widgets::is_sidebar_renderedDetermines if a sidebar is rendered on the page.
WP_Customize_Widgets::is_wide_widgetDetermines whether the widget is considered “wide”.
WP_Customize_Widgets::is_widget_renderedDetermine if a widget is rendered on the page.
WP_Customize_Widgets::is_widget_selective_refreshableDetermines if a widget supports selective refresh.
WP_Customize_Widgets::output_widget_control_templatesRenders the widget form control templates into the DOM.
WP_Customize_Widgets::override_sidebars_widgets_for_theme_switchOverride sidebars_widgets for theme switch.
WP_Customize_Widgets::parse_widget_idConverts a widget ID into its id_base and number components.
WP_Customize_Widgets::parse_widget_setting_idConverts a widget setting ID (option path) to its id_base and number components.
WP_Customize_Widgets::prepreview_added_sidebars_widgets{@internal Missing Summary} — deprecated
WP_Customize_Widgets::prepreview_added_widget_instance{@internal Missing Summary} — deprecated
WP_Customize_Widgets::preview_sidebars_widgetsWhen previewing, ensures the proper previewing widgets are used.