previous_comments_link_attributes хук-фильтрWP 2.7.0

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

Использование

add_filter( 'previous_comments_link_attributes', 'wp_kama_previous_comments_link_attributes_filter' );

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

	// filter...
	return $attributes;
}
$attributes(строка)
Attributes for the anchor tag.

Список изменений

С версии 2.7.0 Введена.

Где вызывается хук

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

Где используется хук в WordPress

wp-includes/blocks/comments-pagination-previous.php 28
add_filter( 'previous_comments_link_attributes', $filter_link_attributes );
wp-includes/blocks/comments-pagination-previous.php 32
remove_filter( 'previous_comments_link_attributes', $filter_link_attributes );