WPDev.one
Core Class

WP_Customize_Widgets

class WP_Customize_Widgets // Constructor: function Object() { [native code] }

Customize Widgets class.

Methods 67 methods

Method / Return Description
__construct()
void

Initial loader.

Parameters: $manager: mixed
get_selective_refreshable_widgets()
array

List whether each registered widget can be use selective refresh.

is_widget_selective_refreshable()
bool

Determines if a widget supports selective refresh.

Parameters: $id_base: mixed
get_setting_type()
(string

Retrieves the widget setting type given a setting ID.

Parameters: $setting_id: mixed
register_settings()
void

Inspects the incoming customized data for any widget settings, and dynamically adds

filter_customize_dynamic_setting_args()
(array

Determines the arguments for a dynamically-created setting.

Parameters: $args: mixed, $setting_id: mixed
get_post_value()
mixed

Retrieves an unslashed post value or return a default.

Parameters: $name: mixed, $default_value: mixed
override_sidebars_widgets_for_theme_switch()
void

Override sidebars_widgets for theme switch.

filter_customize_value_old_sidebars_widgets_data()
array

Filters old_sidebars_widgets_data Customizer setting.

Parameters: $old_sidebars_widgets: mixed
filter_option_sidebars_widgets_for_theme_switch()
array

Filters sidebars_widgets option for theme switch.

Parameters: $sidebars_widgets: mixed
customize_controls_init()
void

Ensures all widgets get loaded into the Customizer.

schedule_customize_register()
void

Ensures widgets are available for all types of previews.

customize_register()
void

Registers Customizer settings and controls for all sidebars and widgets.

is_panel_active()
bool

Determines whether the widgets panel is active, based on whether there are sidebars registered.

get_setting_id()
string

Converts a widget_id into its corresponding Customizer setting ID (option name).

Parameters: $widget_id: mixed
is_wide_widget()
bool

Determines whether the widget is considered "wide".

Parameters: $widget_id: mixed
parse_widget_id()
array

Converts a widget ID into its id_base and number components.

Parameters: $widget_id: mixed
parse_widget_setting_id()
(array

Converts a widget setting ID (option path) to its id_base and number components.

Parameters: $setting_id: mixed
print_styles()
void

Calls admin_print_styles-widgets.php and admin_print_styles hooks to

print_scripts()
void

Calls admin_print_scripts-widgets.php and admin_print_scripts hooks to

enqueue_scripts()
void

Enqueues scripts and styles for Customizer panel and export data to JavaScript.

output_widget_control_templates()
void

Renders the widget form control templates into the DOM.

print_footer_scripts()
void

Calls admin_print_footer_scripts and admin_print_scripts hooks to

get_setting_args()
array

Retrieves common arguments to supply when constructing a Customizer setting.

Parameters: $id: mixed, $overrides: mixed
sanitize_sidebar_widgets()
string[]

Ensures sidebar widget arrays only ever contain widget IDS.

Parameters: $widget_ids: mixed
get_available_widgets()
array

Builds up an index of all available widgets for use in Backbone models.

_sort_name_callback()
int

Naturally orders available widgets by name.

Parameters: $widget_a: mixed, $widget_b: mixed
get_widget_control()
string

Retrieves the widget control markup.

Parameters: $args: mixed
get_widget_control_parts()
array

Retrieves the widget control markup parts.

Parameters: $args: mixed
customize_preview_init()
void

Adds hooks for the Customizer preview.

refresh_nonces()
array

Refreshes the nonce for widget updates.

Parameters: $nonces: mixed
should_load_block_editor_scripts_and_styles()
bool

Tells the script loader to load the scripts and styles of custom blocks

Parameters: $is_block_editor_screen: mixed
preview_sidebars_widgets()
array

When previewing, ensures the proper previewing widgets are used.

Parameters: $sidebars_widgets: mixed
customize_preview_enqueue()
void

Enqueues scripts for the Customizer preview.

print_preview_css()
void

Inserts default style for highlighted widget at early point so theme

export_preview_data()
void

Communicates the sidebars that appeared on the page at the very end of the page,

tally_rendered_widgets()
void

Tracks the widgets that were rendered.

Parameters: $widget: mixed
is_widget_rendered()
bool

Determine if a widget is rendered on the page.

Parameters: $widget_id: mixed
is_sidebar_rendered()
bool

Determines if a sidebar is rendered on the page.

Parameters: $sidebar_id: mixed
tally_sidebars_via_is_active_sidebar_calls()
bool

Tallies the sidebars rendered via is_active_sidebar().

Parameters: $is_active: mixed, $sidebar_id: mixed
tally_sidebars_via_dynamic_sidebar_calls()
bool

Tallies the sidebars rendered via dynamic_sidebar().

Parameters: $has_widgets: mixed, $sidebar_id: mixed
get_instance_hash_key()
string

Retrieves MAC for a serialized widget instance string.

Parameters: $serialized_instance: mixed
sanitize_widget_instance()
(array

Sanitizes a widget instance.

Parameters: $value: mixed, $id_base: mixed
sanitize_widget_js_instance()
array

Converts a widget instance into JSON-representable format.

Parameters: $value: mixed, $id_base: mixed
sanitize_sidebar_widgets_js_instance()
array

Strips out widget IDs for widgets which are no longer registered.

Parameters: $widget_ids: mixed
call_widget_update()
(array

Finds and invokes the widget update and control callbacks.

Parameters: $widget_id: mixed
wp_ajax_update_widget()
void

Updates widget settings asynchronously.

customize_dynamic_partial_args()
array

Filters arguments for dynamic widget partials.

Parameters: $partial_args: mixed, $partial_id: mixed
selective_refresh_init()
void

Adds hooks for selective refresh.

filter_dynamic_sidebar_params()
array

Inject selective refresh data attributes into widget container elements.

Parameters: $params: mixed
filter_wp_kses_allowed_data_attributes()
array

Ensures the HTML data-* attributes for selective refresh are allowed by kses.

Parameters: $allowed_html: mixed
start_dynamic_sidebar()
void

Begins keeping track of the current sidebar being rendered.

Parameters: $index: mixed
end_dynamic_sidebar()
void

Finishes keeping track of the current sidebar being rendered.

Parameters: $index: mixed
filter_sidebars_widgets_for_rendering_widget()
array

Filters sidebars_widgets to ensure the currently-rendered widget is the only widget in the current sidebar.

Parameters: $sidebars_widgets: mixed
render_widget_partial()
(string

Renders a specific widget using the supplied sidebar arguments.

Parameters: $partial: mixed, $context: mixed
is_option_capture_ignored()
bool

Determines whether the captured option update should be ignored.

Parameters: $option_name: mixed
get_captured_options()
array

Retrieves captured widget option updates.

get_captured_option()
mixed

Retrieves the option that was captured from being saved.

Parameters: $option_name: mixed, $default_value: mixed
count_captured_options()
int

Retrieves the number of captured widget option updates.

start_capturing_option_updates()
void

Begins keeping track of changes to widget options, caching new values.

capture_filter_pre_update_option()
mixed

Pre-filters captured option values before updating.

Parameters: $new_value: mixed, $option_name: mixed, $old_value: mixed
capture_filter_pre_get_option()
mixed

Pre-filters captured option values before retrieving.

Parameters: $value: mixed
stop_capturing_option_updates()
void

Undoes any changes to the options since options capture began.

setup_widget_addition_previews()
void

{@internal Missing Summary}

prepreview_added_sidebars_widgets()
void

{@internal Missing Summary}

prepreview_added_widget_instance()
void

{@internal Missing Summary}

remove_prepreview_filters()
void

{@internal Missing Summary}

Properties

Property / Type Description
$manager
mixed
public
No description available.
$core_widget_id_bases
mixed
public
No description available.
$rendered_sidebars
mixed
public
No description available.
$rendered_widgets
mixed
public
No description available.
$old_sidebars_widgets
mixed
public
No description available.
$selective_refreshable_widgets
mixed
public
No description available.
$setting_id_patterns
mixed
public
No description available.
$before_widget_tags_seen
mixed
public
No description available.
$sidebar_instance_count
mixed
public
No description available.
$context_sidebar_instance_number
mixed
public
No description available.
$current_dynamic_sidebar_id_stack
mixed
public
No description available.
$rendering_widget_id
mixed
public
No description available.
$rendering_sidebar_id
mixed
public
No description available.
$_captured_options
mixed
public
No description available.
$_is_capturing_option_updates
mixed
public
No description available.

Class Information

Since Version
3.9.0
Source File
wp-includes/class-wp-customize-widgets.php
Advertisement