I don’t understand. use_desc_for_title in wp_list_categories does not work!

I do not understant.. May be it’s a bug. I try to disable a tooltip on mouse hover on category links by using use_desc_for_title parameter for the wp_list_categories function. It isn’t working! I try to use 0 (false) value as a parameter but it doesn’t matter.

  wp_list_categories('show_count=1&title_li=&use_desc_for_title=0');

Anybody knows what is happening?

I’ve just found a workaround but it’s looked like a hack. I don’t like that. The meaning of this workaround is that you add a filter for the wp_list_categories function that removes title attribute from the each link.

  function wp_list_categories_filter($value) {
    $value = preg_replace('` title="(.+)"`', '', $value);
    return $value;
  }
  add_filter('wp_list_categories', 'wp_list_categories_filter');

2 Responses to “I don’t understand. use_desc_for_title in wp_list_categories does not work!”

  • dre:

    thx for your post , the first method worked fine.

    I tried the 2nd method (hack) it didnt work for me:(

  • Vacheslav:

    dre, could you show me HTML of you link? Maybe you have spaces between “=” or differend quotes. In my case it works ok. I suppose that you need to modify regexp in preg_replace to match your link HTML.