Skip to content

Commit dc31cf0

Browse files
Media: Change link text when attachment pages disabled.
When attachment pages are disabled, change the links from "View Attachment Page" to "View Media File". Follow-up to [56657], [56658]. Props joedolson, ironprogrammer, oglekler. Fixes #57913. git-svn-id: https://develop.svn.wordpress.org/trunk@56711 602fd350-edb4-49c9-b593-d223f7449a82
1 parent ae1484c commit dc31cf0

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/wp-includes/media-template.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,10 @@ function wp_print_media_templates() {
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_attachment_pages_enabled' ) ) ? __( '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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function create_initial_post_types() {
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_attachment_pages_enabled' ) ) ? __( 'View Attachment Page' ) : __( 'View Media File' ),
8181
'attributes' => __( 'Attachment Attributes' ),
8282
),
8383
'public' => true,

0 commit comments

Comments
 (0)