From ca5538dda3ffab81f6239990b950d504ded91215 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 18 Jan 2021 12:05:06 +0000 Subject: [PATCH] Posts, Post Types: Introduce a filter `paginate_links()` output. Props sabernhardt, audrasjb, re.ardestani. Fixes #44018. git-svn-id: https://develop.svn.wordpress.org/trunk@49976 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/general-template.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php index a84ffce694..2963113ef0 100644 --- a/src/wp-includes/general-template.php +++ b/src/wp-includes/general-template.php @@ -4111,7 +4111,7 @@ function language_attributes( $doctype = 'html' ) { } /** - * Retrieve paginated link for archive post pages. + * Retrieves paginated links for archive post pages. * * Technically, the function can be used to create paginated link list for any * area. The 'base' argument is used to reference the url, which will be used to @@ -4357,6 +4357,16 @@ function paginate_links( $args = '' ) { break; } + /** + * Filters the HTML output of paginated links for archives. + * + * @since 5.7.0 + * + * @param string $r HTML output. + * @param array $args An array of arguments. See paginate_links() for accepted arguments. + */ + $r = apply_filters( 'paginate_links_output', $r, $args ); + return $r; }