Media: Hide 'view' link if empty string passed to attachment_link.
Fix empty href attribute on 'View' link when the `attachment_link` filter is used to hide attachment pages. Props oh_hello, iqbalrony. Fixes #54824. Built from https://develop.svn.wordpress.org/trunk@55218 git-svn-id: http://core.svn.wordpress.org/trunk@54751 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4efd5d5623
commit
e7a506c636
@ -768,13 +768,15 @@ class WP_Media_List_Table extends WP_List_Table {
|
||||
}
|
||||
}
|
||||
|
||||
$actions['view'] = sprintf(
|
||||
'<a href="%s" aria-label="%s" rel="bookmark">%s</a>',
|
||||
get_permalink( $post->ID ),
|
||||
/* translators: %s: Attachment title. */
|
||||
esc_attr( sprintf( __( 'View “%s”' ), $att_title ) ),
|
||||
__( 'View' )
|
||||
);
|
||||
if ( get_permalink( $post->ID ) ) {
|
||||
$actions['view'] = sprintf(
|
||||
'<a href="%s" aria-label="%s" rel="bookmark">%s</a>',
|
||||
get_permalink( $post->ID ),
|
||||
/* translators: %s: Attachment title. */
|
||||
esc_attr( sprintf( __( 'View “%s”' ), $att_title ) ),
|
||||
__( 'View' )
|
||||
);
|
||||
}
|
||||
|
||||
if ( current_user_can( 'edit_post', $post->ID ) ) {
|
||||
$actions['attach'] = sprintf(
|
||||
@ -829,13 +831,15 @@ class WP_Media_List_Table extends WP_List_Table {
|
||||
}
|
||||
|
||||
if ( ! $this->is_trash ) {
|
||||
$actions['view'] = sprintf(
|
||||
'<a href="%s" aria-label="%s" rel="bookmark">%s</a>',
|
||||
get_permalink( $post->ID ),
|
||||
/* translators: %s: Attachment title. */
|
||||
esc_attr( sprintf( __( 'View “%s”' ), $att_title ) ),
|
||||
__( 'View' )
|
||||
);
|
||||
if ( get_permalink( $post->ID ) ) {
|
||||
$actions['view'] = sprintf(
|
||||
'<a href="%s" aria-label="%s" rel="bookmark">%s</a>',
|
||||
get_permalink( $post->ID ),
|
||||
/* translators: %s: Attachment title. */
|
||||
esc_attr( sprintf( __( 'View “%s”' ), $att_title ) ),
|
||||
__( 'View' )
|
||||
);
|
||||
}
|
||||
|
||||
$actions['copy'] = sprintf(
|
||||
'<span class="copy-to-clipboard-container"><button type="button" class="button-link copy-attachment-url media-library" data-clipboard-text="%s" aria-label="%s">%s</button><span class="success hidden" aria-hidden="true">%s</span></span>',
|
||||
|
@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.2-alpha-55217';
|
||||
$wp_version = '6.2-alpha-55218';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user