Changeset 52362
- Timestamp:
- 12/13/2021 10:19:21 AM (3 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/widgets.php
r50961 r52362 227 227 // number == -1 implies a template where id numbers are replaced by a generic '__i__'. 228 228 $control['params'][0]['number'] = -1; 229 // With id_base widget id's are constructed like {$id_base}-{$id_number}.229 // With id_base widget ID's are constructed like {$id_base}-{$id_number}. 230 230 if ( isset( $control['id_base'] ) ) { 231 231 $id_format = $control['id_base'] . '-__i__'; -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-sidebars-controller.php
r52016 r52362 220 220 foreach ( $sidebars as $sidebar_id => $widgets ) { 221 221 foreach ( $widgets as $i => $widget_id ) { 222 // This automatically removes the passed widget ids from any other sidebars in use.222 // This automatically removes the passed widget IDs from any other sidebars in use. 223 223 if ( $sidebar_id !== $request['id'] && in_array( $widget_id, $request['widgets'], true ) ) { 224 224 unset( $sidebars[ $sidebar_id ][ $i ] ); 225 225 } 226 226 227 // This automatically removes omitted widget ids to the inactive sidebar.227 // This automatically removes omitted widget IDs to the inactive sidebar. 228 228 if ( $sidebar_id === $request['id'] && ! in_array( $widget_id, $request['widgets'], true ) ) { 229 229 $sidebars['wp_inactive_widgets'][] = $widget_id; -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.php
r52204 r52362 189 189 * @since 5.9.0 190 190 * 191 * @param string $sidebar_id The sidebar id.191 * @param string $sidebar_id The sidebar ID. 192 192 * @return bool Whether the sidebar can be read. 193 193 */ -
trunk/src/wp-includes/widgets.php
r52361 r52362 520 520 * Default 250. 521 521 * @type int|string $id_base Required for multi-widgets, i.e widgets that allow multiple instances such as the 522 * text widget. The widget idwill end up looking like `{$id_base}-{$unique_number}`.522 * text widget. The widget ID will end up looking like `{$id_base}-{$unique_number}`. 523 523 * } 524 524 * @param mixed ...$params Optional additional parameters to pass to the callback function when it's called. … … 1917 1917 * @since 5.8.0 1918 1918 * 1919 * @param string $widget_id The widget idto look for.1920 * @return string|null The found sidebar's id, or null if it was not found.1919 * @param string $widget_id The widget ID to look for. 1920 * @return string|null The found sidebar's ID, or null if it was not found. 1921 1921 */ 1922 1922 function wp_find_widgets_sidebar( $widget_id ) { … … 1937 1937 * @since 5.8.0 1938 1938 * 1939 * @param string $widget_id The widget idto assign.1940 * @param string $sidebar_id The sidebar idto assign to. If empty, the widget won't be added to any sidebar.1939 * @param string $widget_id The widget ID to assign. 1940 * @param string $sidebar_id The sidebar ID to assign to. If empty, the widget won't be added to any sidebar. 1941 1941 */ 1942 1942 function wp_assign_widget_to_sidebar( $widget_id, $sidebar_id ) { … … 1947 1947 if ( $widget_id === $maybe_widget_id && $sidebar_id !== $maybe_sidebar_id ) { 1948 1948 unset( $sidebars[ $maybe_sidebar_id ][ $i ] ); 1949 // We could technically break 2 here, but continue looping in case the idis duplicated.1949 // We could technically break 2 here, but continue looping in case the ID is duplicated. 1950 1950 continue 2; 1951 1951 }
Note: See TracChangeset
for help on using the changeset viewer.