From 6b905688409d019fa572d18718d15a258b46eacd Mon Sep 17 00:00:00 2001 From: antpb Date: Tue, 20 Oct 2020 02:29:06 +0000 Subject: [PATCH] =?UTF-8?q?Media:=20Allow=20hiding=20of=20=E2=80=98View=20?= =?UTF-8?q?attachment=20page=E2=80=99=20link=20in=20media=20modal.=20If=20?= =?UTF-8?q?an=20empty=20string=20is=20supplied=20to=20the=20`attachment=5F?= =?UTF-8?q?link`=20filter=20the=20=E2=80=98View=20attachment=20page?= =?UTF-8?q?=E2=80=99=20link=20will=20be=20hidden=20in=20the=20media=20moda?= =?UTF-8?q?l.=20Props=20limera1n,=20garrett-eclipse,=20joemcgill,=20Mista-?= =?UTF-8?q?Flo,=20hellofromTonya.=20Fixes=20#48325.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Built from https://develop.svn.wordpress.org/trunk@49222 git-svn-id: http://core.svn.wordpress.org/trunk@48984 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/link-template.php | 2 ++ wp-includes/media-template.php | 14 +++++++++++--- wp-includes/version.php | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 9e654aaaeb..519e307764 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -452,6 +452,8 @@ function get_attachment_link( $post = null, $leavename = false ) { * Filters the permalink for an attachment. * * @since 2.0.0 + * @since 5.6.0 Providing an empty string will now disable + * the view attachment page link on the media modal. * * @param string $link The attachment's permalink. * @param int $post_id Attachment ID. diff --git a/wp-includes/media-template.php b/wp-includes/media-template.php index c2b87b28af..9908843b98 100644 --- a/wp-includes/media-template.php +++ b/wp-includes/media-template.php @@ -514,11 +514,19 @@ function wp_print_media_templates() {
- - <# if ( data.can.save ) { #> | + <# if ( data.link ) { #> + + <# } #> + <# if ( data.can.save ) { #> + <# if ( data.link ) { #> + | + <# } #> <# } #> - <# if ( ! data.uploading && data.can.remove ) { #> | + <# if ( ! data.uploading && data.can.remove ) { #> + <# if ( data.link || data.can.save ) { #> + | + <# } #> <# if ( 'trash' === data.status ) { #> diff --git a/wp-includes/version.php b/wp-includes/version.php index e733e4cc44..1853b562ee 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.6-alpha-49221'; +$wp_version = '5.6-alpha-49222'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.