next_comments_link_attributes filter-hookWP 2.7.0

Filters the anchor tag attributes for the next comments page link.

Usage

add_filter( 'next_comments_link_attributes', 'wp_kama_next_comments_link_attributes_filter' );

/**
 * Function for `next_comments_link_attributes` filter-hook.
 * 
 * @param string $attributes Attributes for the anchor tag.
 *
 * @return string
 */
function wp_kama_next_comments_link_attributes_filter( $attributes ){

	// filter...
	return $attributes;
}
$attributes(string)
Attributes for the anchor tag.

Changelog

Since 2.7.0 Introduced.

Where the hook is called

get_next_comments_link()
next_comments_link_attributes
wp-includes/link-template.php 3032
return '<a href="' . esc_url( get_comments_pagenum_link( $nextpage, $max_page ) ) . '" ' . apply_filters( 'next_comments_link_attributes', '' ) . '>' . preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&#038;$1', $label ) . '</a>';

Where the hook is used in WordPress

wp-includes/blocks/comments-pagination-next.php 32
add_filter( 'next_comments_link_attributes', $filter_link_attributes );