Taxonomy: Don't display an empty edit link in taxonomy list table if the user doesn't have permissions to edit the term.
Props grapplerulrich. Fixes #43146. git-svn-id: https://develop.svn.wordpress.org/trunk@42565 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
5110f349a9
commit
10ad912128
@ -377,19 +377,27 @@ class WP_Terms_List_Table extends WP_List_Table {
|
|||||||
|
|
||||||
$uri = wp_doing_ajax() ? wp_get_referer() : $_SERVER['REQUEST_URI'];
|
$uri = wp_doing_ajax() ? wp_get_referer() : $_SERVER['REQUEST_URI'];
|
||||||
|
|
||||||
|
$edit_link = get_edit_term_link( $tag->term_id, $taxonomy, $this->screen->post_type );
|
||||||
|
|
||||||
|
if ( $edit_link ) {
|
||||||
$edit_link = add_query_arg(
|
$edit_link = add_query_arg(
|
||||||
'wp_http_referer',
|
'wp_http_referer',
|
||||||
urlencode( wp_unslash( $uri ) ),
|
urlencode( wp_unslash( $uri ) ),
|
||||||
get_edit_term_link( $tag->term_id, $taxonomy, $this->screen->post_type )
|
$edit_link
|
||||||
);
|
);
|
||||||
|
$name = sprintf(
|
||||||
$out = sprintf(
|
'<a class="row-title" href="%s" aria-label="%s">%s</a>',
|
||||||
'<strong><a class="row-title" href="%s" aria-label="%s">%s</a></strong><br />',
|
|
||||||
esc_url( $edit_link ),
|
esc_url( $edit_link ),
|
||||||
/* translators: %s: taxonomy term name */
|
/* translators: %s: taxonomy term name */
|
||||||
esc_attr( sprintf( __( '“%s” (Edit)' ), $tag->name ) ),
|
esc_attr( sprintf( __( '“%s” (Edit)' ), $tag->name ) ),
|
||||||
$name
|
$name
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$out = sprintf(
|
||||||
|
'<strong>%s</strong><br />',
|
||||||
|
$name
|
||||||
|
);
|
||||||
|
|
||||||
$out .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">';
|
$out .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">';
|
||||||
$out .= '<div class="name">' . $qe_data->name . '</div>';
|
$out .= '<div class="name">' . $qe_data->name . '</div>';
|
||||||
|
Loading…
Reference in New Issue
Block a user