From 751a7b81e35dacff9b5fc70b4f769597626bf3d5 Mon Sep 17 00:00:00 2001 From: David Baumwald Date: Tue, 13 Sep 2022 18:03:30 +0000 Subject: [PATCH] General: Add a new filter for `the_posts_pagination_args`. Props pbiron, joyously, audrasjb, robinwpdeveloper. Fixes 53392. git-svn-id: https://develop.svn.wordpress.org/trunk@54144 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/link-template.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/wp-includes/link-template.php b/src/wp-includes/link-template.php index 1732742654..de9988be1f 100644 --- a/src/wp-includes/link-template.php +++ b/src/wp-includes/link-template.php @@ -2870,6 +2870,22 @@ function get_the_posts_pagination( $args = array() ) { ) ); + /** + * 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'. + * } + */ + $args = apply_filters( 'the_posts_pagination_args', $args ); + // Make sure we get a string back. Plain is the next best thing. if ( isset( $args['type'] ) && 'array' === $args['type'] ) { $args['type'] = 'plain';