Uses
Uses | Description |
---|---|
wp-includes/option.php: get_option() | Retrieves an option value based on an option name. |
When previewing, ensures the proper previewing widgets are used.
Because wp_get_sidebars_widgets() gets called early at ‘init’ (via wp_convert_widget_settings()) and can set global variable $_wp_sidebars_widgets
to the value of get_option( 'sidebars_widgets' )
before the Customizer preview filter is added, it has to be reset after the filter has been added.
(array) (Required) List of widgets for the current sidebar.
(array)
File: wp-includes/class-wp-customize-widgets.php
public function preview_sidebars_widgets( $sidebars_widgets ) { $sidebars_widgets = get_option( 'sidebars_widgets', array() ); unset( $sidebars_widgets['array_version'] ); return $sidebars_widgets; }
Version | Description |
---|---|
3.9.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_customize_widgets/preview_sidebars_widgets