Changeset 51842
- Timestamp:
- 09/21/2021 10:12:18 PM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/widgets.php
r51791 r51842 1256 1256 1257 1257 /** 1258 * Look for "lost" widgets, this has to run at least on each theme change. 1258 * Validates and remaps any "orphaned" widgets to wp_inactive_sidgets sidebar, and saves the widget settings. 1259 * This has to run at least on each theme change. 1260 * 1261 * For example, let's say theme A has a "footer" sidebar, and theme B doesn't have one. 1262 * After switching from theme A to theme B, all the widgets previously assigned to the footer would be inaccessible. 1263 * This function detects this scenario, and moves all the widgets previously assigned to the footer under wp_inactive_widgets. 1264 * 1265 * Despite the word "retrieve" in the name, this function actually updates the database and the global $sidebars_widgets. 1266 * For that reason it should not be run from the front end unless the param value is 'customize' (to bypass the database write). 1259 1267 * 1260 1268 * @since 2.8.0 … … 1311 1319 1312 1320 if ( 'customize' !== $theme_changed ) { 1321 // Update the widgets settings in the database. 1313 1322 wp_set_sidebars_widgets( $sidebars_widgets ); 1314 1323 }
Note: See TracChangeset
for help on using the changeset viewer.