Media: Allow hiding of ‘View attachment page’ link in media modal.
If an empty string is supplied to the `attachment_link` filter the ‘View attachment page’ link will be hidden in the media modal. Props limera1n, garrett-eclipse, joemcgill, Mista-Flo, hellofromTonya. Fixes #48325. git-svn-id: https://develop.svn.wordpress.org/trunk@49222 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
16468a23ac
commit
b95d64f62a
@ -452,6 +452,8 @@ function get_attachment_link( $post = null, $leavename = false ) {
|
|||||||
* Filters the permalink for an attachment.
|
* Filters the permalink for an attachment.
|
||||||
*
|
*
|
||||||
* @since 2.0.0
|
* @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 string $link The attachment's permalink.
|
||||||
* @param int $post_id Attachment ID.
|
* @param int $post_id Attachment ID.
|
||||||
|
@ -514,11 +514,19 @@ function wp_print_media_templates() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<a class="view-attachment" href="{{ data.link }}"><?php _e( 'View attachment page' ); ?></a>
|
<# if ( data.link ) { #>
|
||||||
<# if ( data.can.save ) { #> |
|
<a class="view-attachment" href="{{ data.link }}"><?php _e( 'View attachment page' ); ?></a>
|
||||||
|
<# } #>
|
||||||
|
<# if ( data.can.save ) { #>
|
||||||
|
<# if ( data.link ) { #>
|
||||||
|
<span class="links-separator">|</span>
|
||||||
|
<# } #>
|
||||||
<a href="{{ data.editLink }}"><?php _e( 'Edit more details' ); ?></a>
|
<a href="{{ data.editLink }}"><?php _e( 'Edit more details' ); ?></a>
|
||||||
<# } #>
|
<# } #>
|
||||||
<# if ( ! data.uploading && data.can.remove ) { #> |
|
<# if ( ! data.uploading && data.can.remove ) { #>
|
||||||
|
<# if ( data.link || data.can.save ) { #>
|
||||||
|
<span class="links-separator">|</span>
|
||||||
|
<# } #>
|
||||||
<?php if ( MEDIA_TRASH ) : ?>
|
<?php if ( MEDIA_TRASH ) : ?>
|
||||||
<# if ( 'trash' === data.status ) { #>
|
<# if ( 'trash' === data.status ) { #>
|
||||||
<button type="button" class="button-link untrash-attachment"><?php _e( 'Restore from Trash' ); ?></button>
|
<button type="button" class="button-link untrash-attachment"><?php _e( 'Restore from Trash' ); ?></button>
|
||||||
|
Loading…
Reference in New Issue
Block a user