Quantcast
Channel: Always show same size tags for Tag Cloud in Wordpress Admin - WordPress Development Stack Exchange
Viewing all articles
Browse latest Browse all 4

Answer by s_ha_dum for Always show same size tags for Tag Cloud in Wordpress Admin

$
0
0

With wp_tag_cloud you can set the smallest and largest argument to the same value:

$args = array('smallest'                  => 8, 'largest'                   => 8,);echo wp_tag_cloud($args);

Unfortunately, that would require hacking the Core. Also, unfortunately, I don't see a filter that will allow you to alter those argument directly, so you are going to have to do this a bit brute-force-y.

add_action('load-edit-tags.php',  function () {    add_filter('wp_generate_tag_cloud',      function ($return) {        $pat = '|font-size: [0-9]+([^;]+)|';        return preg_replace($pat,'8$1',$return);      },      1,2    );  });

Hooking to load-edit-tags.php should cause this to operate only on the wp-admin/edit-tags.php page on the backend, which is what I assume you want.Reference: http://codex.wordpress.org/Function_Reference/wp_tag_cloud


Viewing all articles
Browse latest Browse all 4

Trending Articles