wp_widgets_init()
Registers all of the default WordPress widgets on startup.
Calls widgets_init action after all of the WordPress widgets have been registered.
Uses: register_widget()
Hooks from the function
Return
null
. Nothing (null).
Usage
wp_widgets_init();
Examples
#1 Disable all default WordPress widgets
If you create a theme where widgets are not used, you can disconnect them so they don't get in the way.
remove_action( 'init', 'wp_widgets_init', 1 );
When adding this code, it is important to keep in mind that the widgets_init hook will also stop working, because it is called from a function whose call we undid.
Changelog
Since 2.2.0 | Introduced. |