Administration: Remove Edit
links from all plugin listing screens and the remaining theme listing screens.
This simplifies these list tables, reducing user confusion, without removing functionality. Fixes #38169 git-svn-id: https://develop.svn.wordpress.org/trunk@41160 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c6c413403d
commit
609aaef919
@ -395,7 +395,6 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
|
|||||||
$actions = array(
|
$actions = array(
|
||||||
'enable' => '',
|
'enable' => '',
|
||||||
'disable' => '',
|
'disable' => '',
|
||||||
'edit' => '',
|
|
||||||
'delete' => ''
|
'delete' => ''
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -448,21 +447,6 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( current_user_can('edit_themes') ) {
|
|
||||||
$url = add_query_arg( array(
|
|
||||||
'theme' => $theme_key,
|
|
||||||
), 'theme-editor.php' );
|
|
||||||
|
|
||||||
/* translators: %s: theme name */
|
|
||||||
$aria_label = sprintf( __( 'Open %s in the Theme Editor' ), $theme->display( 'Name' ) );
|
|
||||||
|
|
||||||
$actions['edit'] = sprintf( '<a href="%s" class="edit" aria-label="%s">%s</a>',
|
|
||||||
esc_url( $url ),
|
|
||||||
esc_attr( $aria_label ),
|
|
||||||
__( 'Edit' )
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( ! $allowed && current_user_can( 'delete_themes' ) && ! $this->is_site_themes && $stylesheet != get_option( 'stylesheet' ) && $stylesheet != get_option( 'template' ) ) {
|
if ( ! $allowed && current_user_can( 'delete_themes' ) && ! $this->is_site_themes && $stylesheet != get_option( 'stylesheet' ) && $stylesheet != get_option( 'template' ) ) {
|
||||||
$url = add_query_arg( array(
|
$url = add_query_arg( array(
|
||||||
'action' => 'delete-selected',
|
'action' => 'delete-selected',
|
||||||
@ -492,10 +476,10 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
|
|||||||
* non-network enabled themes when editing a site in the Network admin.
|
* non-network enabled themes when editing a site in the Network admin.
|
||||||
*
|
*
|
||||||
* The default action links for the Network themes list table include
|
* The default action links for the Network themes list table include
|
||||||
* 'Network Enable', 'Network Disable', 'Edit', and 'Delete'.
|
* 'Network Enable', 'Network Disable', and 'Delete'.
|
||||||
*
|
*
|
||||||
* The default action links for the Site themes list table include
|
* The default action links for the Site themes list table include
|
||||||
* 'Enable', 'Disable', and 'Edit'.
|
* 'Enable', and 'Disable'.
|
||||||
*
|
*
|
||||||
* @since 2.8.0
|
* @since 2.8.0
|
||||||
*
|
*
|
||||||
|
@ -556,7 +556,6 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
|||||||
'deactivate' => '',
|
'deactivate' => '',
|
||||||
'activate' => '',
|
'activate' => '',
|
||||||
'details' => '',
|
'details' => '',
|
||||||
'edit' => '',
|
|
||||||
'delete' => '',
|
'delete' => '',
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -637,10 +636,6 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
|||||||
|
|
||||||
} // end if $screen->in_admin( 'network' )
|
} // end if $screen->in_admin( 'network' )
|
||||||
|
|
||||||
if ( ( ! is_multisite() || $screen->in_admin( 'network' ) ) && current_user_can( 'edit_plugins' ) && is_writable( WP_PLUGIN_DIR . '/' . $plugin_file ) ) {
|
|
||||||
/* translators: %s: plugin name */
|
|
||||||
$actions['edit'] = '<a href="plugin-editor.php?file=' . $plugin_file . '" class="edit" aria-label="' . esc_attr( sprintf( __( 'Edit %s' ), $plugin_data['Name'] ) ) . '">' . __( 'Edit' ) . '</a>';
|
|
||||||
}
|
|
||||||
} // end if $context
|
} // end if $context
|
||||||
|
|
||||||
$actions = array_filter( $actions );
|
$actions = array_filter( $actions );
|
||||||
@ -651,7 +646,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
|||||||
* Filters the action links displayed for each plugin in the Network Admin Plugins list table.
|
* Filters the action links displayed for each plugin in the Network Admin Plugins list table.
|
||||||
*
|
*
|
||||||
* The default action links for the Network plugins list table include
|
* The default action links for the Network plugins list table include
|
||||||
* 'Network Activate', 'Network Deactivate', 'Edit', and 'Delete'.
|
* 'Network Activate', 'Network Deactivate', and 'Delete'.
|
||||||
*
|
*
|
||||||
* @since 3.1.0
|
* @since 3.1.0
|
||||||
*
|
*
|
||||||
@ -687,8 +682,8 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
|||||||
* Filters the action links displayed for each plugin in the Plugins list table.
|
* Filters the action links displayed for each plugin in the Plugins list table.
|
||||||
*
|
*
|
||||||
* The default action links for the site plugins list table include
|
* The default action links for the site plugins list table include
|
||||||
* 'Activate', 'Deactivate', and 'Edit', for a network site, and
|
* 'Activate', and 'Deactivate', for a network site, and
|
||||||
* 'Activate', 'Deactivate', 'Edit', and 'Delete' for a single site.
|
* 'Activate', 'Deactivate', and 'Delete' for a single site.
|
||||||
*
|
*
|
||||||
* @since 2.5.0
|
* @since 2.5.0
|
||||||
* @since 2.6.0 The `$context` parameter was added.
|
* @since 2.6.0 The `$context` parameter was added.
|
||||||
|
Loading…
Reference in New Issue
Block a user