When previewing, ensures the proper previewing widgets are used.
Description
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.
Parameters
$sidebars_widgetsarray
List of widgets for the current sidebar.
Return
array
Uses · 1
get_option()Retrieves an option value based on an option name.
Signature, return type and hooks compared across 5 parsed releases.
About this page
Parsed data
Generated from the wordpress-develop 7.0.4 tag, from src/wp-includes/class-wp-customize-widgets.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.