Skip to content

Instantly share code, notes, and snippets.

@dboutote
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dboutote/af1025196291abc6408a to your computer and use it in GitHub Desktop.
Save dboutote/af1025196291abc6408a to your computer and use it in GitHub Desktop.
Remove the category taxonomy drop down from the posts lists table in WordPress Admin (edit.php)
<?php
/**
* Remove the category taxonomy drop down from the posts lists table
*
* @param string $output The resulting HTML to build the select dropdown
* @param array $r The array of arguments to build the select dropdown
*
* @return string $output The filtered HTML of the dropdown
*/
function db_remove_category_dropdown($output, $r ){
global $pagenow;
if( 'category' === $r['taxonomy'] && 'edit.php' === $pagenow ){
$output = '';
}
return $output;
}
add_filter('wp_dropdown_cats', 'db_remove_category_dropdown', 0, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment