Skip to content

Instantly share code, notes, and snippets.

@joje47
Last active July 24, 2016 07:43
Show Gist options
  • Select an option

  • Save joje47/d197c8f92e65e1e1333c841b5b73646e to your computer and use it in GitHub Desktop.

Select an option

Save joje47/d197c8f92e65e1e1333c841b5b73646e to your computer and use it in GitHub Desktop.
Shows registered widgets in wordpress, so it's easier to get their names, and remove them at will.
add_action( 'wp_footer', function() // works best, but does not show up if the footer is removed..
// add_action( 'admin_menu', function() // Hides a bit, but copy and past to textfile to read
{
if ( empty ( $GLOBALS['wp_widget_factory'] ) )
return;
$widgets = array_keys( $GLOBALS['wp_widget_factory']->widgets );
print '<pre>$widgets = ' . esc_html( var_export( $widgets, TRUE ) ) . '</pre>';
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment