Modifies tag cloud widget arguments to display all tags in the same font size and use list format for better accessibility.
/**
* Modifies tag cloud widget arguments to display all tags in the same font size
* and use list format for better accessibility.
*
* @param array $args Arguments for tag cloud widget.
* @return array The filtered arguments for tag cloud widget.
*/
function prefix_widget_tag_cloud_args( $args ) {
$args['largest'] = 1;
$args['smallest'] = 1;
$args['unit'] = 'em';
$args['format'] = 'list';
return $args;
}
add_filter( 'widget_tag_cloud_args', 'prefix_widget_tag_cloud_args' 10, 1 );
It appears this filter does not even run when using a Gutenburg tag cloud anymore.
Modifies tag cloud widget arguments to display all tags in the same font size and use list format for better accessibility.
Example Migrated from Codex:
Include specific tag IDs in tag cloud widget.