From 8947acbf9bfc0c8e751829b4e6942b40dd4cc364 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Tue, 8 Jan 2019 09:09:49 +0000 Subject: [PATCH] Media: Add `$attr` to the `wp_get_attachment_link` filter. Props danielbachhuber. Fixes #40155. Built from https://develop.svn.wordpress.org/trunk@44471 git-svn-id: http://core.svn.wordpress.org/trunk@44302 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post-template.php | 4 +++- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 5d8ba5a1d4..3cf0c7c48f 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -1602,6 +1602,7 @@ function wp_get_attachment_link( $id = 0, $size = 'thumbnail', $permalink = fals * Filters a retrieved attachment page link. * * @since 2.7.0 + * @since 5.1.0 Added the $attr parameter. * * @param string $link_html The page link HTML output. * @param int $id Post ID. @@ -1610,8 +1611,9 @@ function wp_get_attachment_link( $id = 0, $size = 'thumbnail', $permalink = fals * @param bool $permalink Whether to add permalink to image. Default false. * @param bool $icon Whether to include an icon. Default false. * @param string|bool $text If string, will be link text. Default false. + * @param array|string $attr Array or string of attributes. Default empty. */ - return apply_filters( 'wp_get_attachment_link', "$link_text", $id, $size, $permalink, $icon, $text ); + return apply_filters( 'wp_get_attachment_link', "$link_text", $id, $size, $permalink, $icon, $text, $attr ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 77088c8225..d45a010685 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.1-alpha-44470'; +$wp_version = '5.1-alpha-44471'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.