Make WordPress Core

Ticket #57913: 57913.2.diff

File 57913.2.diff, 1.4 KB (added by joedolson, 21 months ago)

Change text links based on attachment page status

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

     
    557557
    558558                        <div class="actions">
    559559                                <# if ( data.link ) { #>
    560                                         <a class="view-attachment" href="{{ data.link }}"><?php _e( 'View attachment page' ); ?></a>
     560                                        <?php
     561                                        $view_media_text = ( '1' === get_option( 'wp_media_use_attachment_pages' ) ) ? __( 'View attachment page' ) : __( 'View media file' );
     562                                        ?>
     563                                        <a class="view-attachment" href="{{ data.link }}"><?php echo $view_media_text; ?></a>
    561564                                <# } #>
    562565                                <# if ( data.can.save ) { #>
    563566                                        <# if ( data.link ) { #>
  • src/wp-includes/post.php

     
    7777                                'name_admin_bar' => _x( 'Media', 'add new from admin bar' ),
    7878                                'add_new'        => __( 'Add New Media File' ),
    7979                                'edit_item'      => __( 'Edit Media' ),
    80                                 'view_item'      => __( 'View Attachment Page' ),
     80                                'view_item'      => ( '1' === get_option( 'wp_media_use_attachment_pages' ) ) ? __( 'View attachment page' ) : __( 'View media file' ),
    8181                                'attributes'     => __( 'Attachment Attributes' ),
    8282                        ),
    8383                        'public'                => true,