Filter hook 'previous_comments_link_attributes'

in WP Core File wp-includes/link-template.php at line 3218

View Source

previous_comments_link_attributes

Filter Hook
Description
Filters the anchor tag attributes for the previous comments page link.

Hook Information

File Location wp-includes/link-template.php View on GitHub
Hook Type Filter
Line Number 3218

Hook Parameters

Type Name Description
string $attributes Attributes for the anchor tag.

Usage Examples

Basic Usage
<?php
// Hook into previous_comments_link_attributes
add_filter('previous_comments_link_attributes', 'my_custom_filter', 10, 1);

function my_custom_filter($attributes) {
    // Your custom filtering logic here
    return $attributes;
}

Source Code Context

wp-includes/link-template.php:3218 - How this hook is used in WordPress core
<?php
3213  	 *
3214  	 * @since 2.7.0
3215  	 *
3216  	 * @param string $attributes Attributes for the anchor tag.
3217  	 */
3218  	$attr = apply_filters( 'previous_comments_link_attributes', '' );
3219  
3220  	return sprintf(
3221  		'<a href="%1$s" %2$s>%3$s</a>',
3222  		esc_url( get_comments_pagenum_link( $previous_page ) ),
3223  		$attr,

PHP Documentation

<?php
/**
	 * Filters the anchor tag attributes for the previous comments page link.
	 *
	 * @since 2.7.0
	 *
	 * @param string $attributes Attributes for the anchor tag.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/link-template.php
Related Hooks

Related hooks will be displayed here in future updates.