Make WordPress Core

Ticket #48325: 48325.8.diff

File 48325.8.diff, 1.7 KB (added by garrett-eclipse, 3 years ago)

Minor refresh to add a @since 5.6.0 comment to the attachment_link filter.

  • src/wp-includes/link-template.php

     
    452452         * Filters the permalink for an attachment.
    453453         *
    454454         * @since 2.0.0
     455         * @since 5.6.0 Providing an empty string will now disable
     456         * the view attachment page link on the media modal.
    455457         *
    456458         * @param string $link    The attachment's permalink.
    457459         * @param int    $post_id Attachment ID.
  • src/wp-includes/media-template.php

     
    511511                        </div>
    512512
    513513                        <div class="actions">
    514                                 <a class="view-attachment" href="{{ data.link }}"><?php _e( 'View attachment page' ); ?></a>
    515                                 <# if ( data.can.save ) { #> |
     514                                <# if ( data.link ) { #>
     515                                        <a class="view-attachment" href="{{ data.link }}"><?php _e( 'View attachment page' ); ?></a>
     516                                <# } #>
     517                                <# if ( data.can.save ) { #>
     518                                        <# if ( data.link ) { #>
     519                                                <span class="links-separator">|</span>
     520                                        <# } #>
    516521                                        <a href="{{ data.editLink }}"><?php _e( 'Edit more details' ); ?></a>
    517522                                <# } #>
    518                                 <# if ( ! data.uploading && data.can.remove ) { #> |
     523                                <# if ( ! data.uploading && data.can.remove ) { #>
     524                                        <# if ( data.link || data.can.save ) { #>
     525                                                <span class="links-separator">|</span>
     526                                        <# } #>
    519527                                        <?php if ( MEDIA_TRASH ) : ?>
    520528                                                <# if ( 'trash' === data.status ) { #>
    521529                                                        <button type="button" class="button-link untrash-attachment"><?php _e( 'Restore from Trash' ); ?></button>