From 609aaef919989f9ec778423adf7d49798a9ee6a2 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Wed, 26 Jul 2017 23:27:47 +0000 Subject: [PATCH] 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 --- .../class-wp-ms-themes-list-table.php | 20 ++----------------- .../includes/class-wp-plugins-list-table.php | 11 +++------- 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/src/wp-admin/includes/class-wp-ms-themes-list-table.php b/src/wp-admin/includes/class-wp-ms-themes-list-table.php index 0f3865a985..8e4c789dbb 100644 --- a/src/wp-admin/includes/class-wp-ms-themes-list-table.php +++ b/src/wp-admin/includes/class-wp-ms-themes-list-table.php @@ -395,7 +395,6 @@ class WP_MS_Themes_List_Table extends WP_List_Table { $actions = array( 'enable' => '', 'disable' => '', - 'edit' => '', '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( '%s', - 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' ) ) { $url = add_query_arg( array( '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. * * 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 - * 'Enable', 'Disable', and 'Edit'. + * 'Enable', and 'Disable'. * * @since 2.8.0 * diff --git a/src/wp-admin/includes/class-wp-plugins-list-table.php b/src/wp-admin/includes/class-wp-plugins-list-table.php index 136fbd4c73..9373d852cf 100644 --- a/src/wp-admin/includes/class-wp-plugins-list-table.php +++ b/src/wp-admin/includes/class-wp-plugins-list-table.php @@ -556,7 +556,6 @@ class WP_Plugins_List_Table extends WP_List_Table { 'deactivate' => '', 'activate' => '', 'details' => '', - 'edit' => '', 'delete' => '', ); @@ -637,10 +636,6 @@ class WP_Plugins_List_Table extends WP_List_Table { } // 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'] = '' . __( 'Edit' ) . ''; - } } // end if $context $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. * * 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 * @@ -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. * * The default action links for the site plugins list table include - * 'Activate', 'Deactivate', and 'Edit', for a network site, and - * 'Activate', 'Deactivate', 'Edit', and 'Delete' for a single site. + * 'Activate', and 'Deactivate', for a network site, and + * 'Activate', 'Deactivate', and 'Delete' for a single site. * * @since 2.5.0 * @since 2.6.0 The `$context` parameter was added.