Skip to content

Instantly share code, notes, and snippets.

@feastdesignco
Last active October 6, 2019 11:02
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 feastdesignco/f9f603422b8d4cc73c04f1592d983198 to your computer and use it in GitHub Desktop.
Save feastdesignco/f9f603422b8d4cc73c04f1592d983198 to your computer and use it in GitHub Desktop.
custom_prevent_cat_description_output
add_filter('widget_categories_args', 'custom_widget_categories_args_filter', 11, 1);
/*
* removes the "category description" from being displayed as the title tag in the category link for the "categories" widget
* not sure why they decided to do this by default - it's a dumb feature - but at least it can be filtered
* add this to the code snippets plugin
* reference: https://codex.wordpress.org/Plugin_API/Filter_Reference/widget_categories_args
*/
function custom_widget_categories_args_filter( $cat_args )
{
$cat_args['use_desc_for_title'] = false; // bool or int
return $cat_args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment