{$prefix}_comment_attributes
This is a filter hook that can be used for filtering the output of the hybrid_comment_attributes() function, which displays the attributes for the comment container.
Parameters
This hook passes a single parameter of $attributes
, which is an array of attribute/value pairs for the comment container element.
Usage
The following code removes the id
attribute.
Add this code to your theme setup function:
add_filter( "{$prefix}_comment_attributes", 'my_comment_attributes' );
Add to your theme’s functions.php
:
function my_comment_attributes( $attributes ) {
unset( $attributes['id'] );
return $attributes;
}