How to remove title attribute in links?

Posted in: Newsmag
Post count: 217

Hi,

maybe it’s not really theme related, but I have to ask.

I want to remove the title attributes (tooltip) from links in the content and sidebar. How can I do that? I have this code…how to extend the code for content and sidebar?

// Remove attribut title
function opt_remove_title_attr($return){
$patterns = array(0=>’# title=\”(.?)\”#’,1=>”# title='(.?)’#”);
return preg_replace($patterns, ”,$return);
}

add_filter(‘wp_nav_menu’, ‘opt_remove_title_attr’);
add_filter(‘wp_page_menu’, ‘opt_remove_title_attr’);
add_filter(‘wp_list_categories’, ‘opt_remove_title_attr’);
add_filter(‘wp_list_pages’, ‘opt_remove_title_attr’);
add_filter(‘wp_tag_cloud’, ‘opt_remove_title_attr’);
add_filter(‘get_archives_link’, ‘opt_remove_title_attr’);

Thank you!

Post count: 6600

Hi,

As you also stated this is not theme related and unfortunately we can’t offer you a quick solution for this. I suggest you get someone to help you with this if you don’t know how to do it yourself or try to find a solution online.

Thanks

Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘Newsmag’ is closed to new topics and replies.