From 14db3459fe4ecbd351856fe3ba2faa2a3767a3a5 Mon Sep 17 00:00:00 2001
From: Paul Biron <paul@sparrowhawkcomputing.com>
Date: Sun, 13 Jun 2021 11:25:02 -0600
Subject: [PATCH] Add `the_posts_pagination_args` filter.

---
 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 0ff33466e8..057412e504 100644
--- a/src/wp-includes/link-template.php
+++ b/src/wp-includes/link-template.php
@@ -2846,6 +2846,22 @@ function get_the_posts_pagination( $args = array() ) {
 			)
 		);
 
+		/**
+		 * Filters the arguments for posts pagination links.
+		 *
+		 * @since 5.9.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';
-- 
2.30.2.windows.1

