Skip to content

Instantly share code, notes, and snippets.

@saltnpixels
Created June 14, 2021 17:13
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 saltnpixels/069745b33693801f8c07f1b86a369e9e to your computer and use it in GitHub Desktop.
Save saltnpixels/069745b33693801f8c07f1b86a369e9e to your computer and use it in GitHub Desktop.
wp remove Tag cloud sizes
if ( ! function_exists( 'set_tag_cloud_sizes' ) ) {
/**
* Removes the inline font sizing.
*
* @param string $tags holds markup of tags
*
* @return string
*/
function set_tag_cloud_sizes( string $tags ): string {
return preg_replace( '/style="font-size: \d+pt;"/', '', $tags );
}
}
add_filter( 'wp_generate_tag_cloud', $n( 'set_tag_cloud_sizes' ), 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment