Answer the question
In order to leave comments, you need to log in
How to remove role=list in wordpress?
When displaying the tag cloud
, role=list appears.
How can I remove this attribute through the theme's function? And preferably without editing the engine files, as it will crash during the update <ul class='wp-tag-cloud' role='list'>
Answer the question
In order to leave comments, you need to log in
https://wp-kama.ru/function/wp_tag_cloud
Set array format and display as you want.
Code from function:
switch ( $args['format'] ) {
case 'array' :
$return =& $a;
break;
case 'list' :
/*
* Force role="list", as some browsers (sic: Safari 10) don't expose to assistive
* technologies the default role when the list is styled with `list-style: none`.
* Note: this is redundant but doesn't harm.
*/
$return = "<ul class='wp-tag-cloud' role='list'>\n\t<li>";
$return .= join( "</li>\n\t<li>", $a );
$return .= "</li>\n</ul>\n";
break;
default :
$return = join( $args['separator'], $a );
break;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question