Last active
January 28, 2020 16:48
-
-
Save IAmAdamTaylor/950a3a78e76100804bc306c085e20752 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'get_the_categories', 'adt_remove_uncategorised_post_category', 20, 2 ); | |
function adt_remove_uncategorised_post_category( $categories, $id ) { | |
return array_filter($categories, function($a) { | |
return 'uncategorised' === $a->slug ? false : $a; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment