A WordPress-centric search engine for devs and theme authors



wp_unregister_sidebar_widget ›

Since2.2.0
Deprecatedn/a
wp_unregister_sidebar_widget ( $id )
Parameters:
  • (int|string) $id Widget ID.
    Required: Yes
Defined at:
Codex:

Remove widget from sidebar.



Source

function wp_unregister_sidebar_widget( $id ) {

	/**
	 * Fires just before a widget is removed from a sidebar.
	 *
	 * @since 3.0.0
	 *
	 * @param int $id The widget ID.
	 */
	do_action( 'wp_unregister_sidebar_widget', $id );

	wp_register_sidebar_widget( $id, '', '' );
	wp_unregister_widget_control( $id );
}