如果您使用widgets.php
, 那么就这么简单了:
// final function makes most sense
// (useing stuff like `$GLOBALS[\'wp_widget_factory\']` will do nothing better than this ex.)
// place inside your functions.php
unregister_widget( \'some widget\' );
// if my search results are right, these should be the available default widgets
// from /wp-includes/widgets.php
Line 389: \'wp_widget_pages\',
Line 390: \'wp_widget_pages_control\',
Line 391: \'wp_widget_calendar\',
Line 392: \'wp_widget_calendar_control\',
Line 393: \'wp_widget_archives\',
Line 394: \'wp_widget_archives_control\',
Line 395: \'wp_widget_links\',
Line 396: \'wp_widget_meta\',
Line 397: \'wp_widget_meta_control\',
Line 398: \'wp_widget_search\',
Line 399: \'wp_widget_recent_entries\',
Line 400: \'wp_widget_recent_entries_control\',
Line 401: \'wp_widget_tag_cloud\',
Line 402: \'wp_widget_tag_cloud_control\',
Line 403: \'wp_widget_categories\',
Line 404: \'wp_widget_categories_control\',
Line 405: \'wp_widget_text\',
Line 406: \'wp_widget_text_control\',
Line 407: \'wp_widget_rss\',
Line 408: \'wp_widget_rss_control\',
Line 409: \'wp_widget_recent_comments\',
Line 410: \'wp_widget_recent_comments_control\'