Filter hook 'the_posts_pagination_args'

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

View Source

the_posts_pagination_args

Filter Hook
Description
Filters the arguments for posts pagination links. Default 'Posts navigation'. }

Hook Information

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

Hook Parameters

Type Name Description
array $args { Optional. Default pagination arguments, see paginate_links().

Usage Examples

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

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

Source Code Context

wp-includes/link-template.php:2978 - How this hook is used in WordPress core
<?php
2973  		 *                                      Default 'Posts navigation'.
2974  		 *     @type string $aria_label         ARIA label text for the nav element. Default 'Posts'.
2975  		 *     @type string $class              Custom class for the nav element. Default 'pagination'.
2976  		 * }
2977  		 */
2978  		$args = apply_filters( 'the_posts_pagination_args', $args );
2979  
2980  		// Make sure we get a string back. Plain is the next best thing.
2981  		if ( isset( $args['type'] ) && 'array' === $args['type'] ) {
2982  			$args['type'] = 'plain';
2983  		}

PHP Documentation

<?php
/**
		 * Filters the arguments for posts pagination links.
		 *
		 * @since 6.1.0
		 *
		 * @param array $args {
		 *     Optional. Default pagination arguments, see paginate_links().
		 *
		 *     @type string $screen_reader_text Screen reader text for navigation element.
		 *                                      Default 'Posts navigation'.
		 *     @type string $aria_label         ARIA label text for the nav element. Default 'Posts'.
		 *     @type string $class              Custom class for the nav element. Default 'pagination'.
		 * }
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/link-template.php
Related Hooks

Related hooks will be displayed here in future updates.