wp_assign_widget_to_sidebar
wp_assign_widget_to_sidebar ( $widget_id, $sidebar_id )
Parameters:- (string) widget_id The widget ID to assign.
- (string) sidebar_id The sidebar ID to assign to. If empty, the widget won't be added to any sidebar.
Defined at: - Introduced in WordPress: 5.8.0
- Deprecated in WordPress: —
Description
Assigns a widget to the given sidebar.