mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-04 20:54:29 +00:00
Plugin/Theme Uploads: New capabilities; unify UIs; ensure compatibility with old filters.
Introduce upload_plugins and upload_themes capabilities to allow blocking of plugin and theme uploads, versus the old hacky (and not secure) ways of just hiding UI tabs. These are simply meta capabilities that map to install_plugins and install_themes. Also: * Use the same nice design for the plugin upload screen as the theme upload screen. * Better compatibility for the old install_themes_tabs filter added in [29002]. see #28578. * Ensure using the install_plugins_tabs filter to remove the upload tab removes the new button. * Use 'Add Plugins' instead of 'Install Plugins' to match 'Add Themes'. fixes #29236. git-svn-id: https://develop.svn.wordpress.org/trunk@29634 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -123,8 +123,9 @@ if ( isset($_GET['action']) ) {
|
||||
|
||||
} elseif ( 'upload-plugin' == $action ) {
|
||||
|
||||
if ( ! current_user_can('install_plugins') )
|
||||
if ( ! current_user_can( 'upload_plugins' ) ) {
|
||||
wp_die( __( 'You do not have sufficient permissions to install plugins on this site.' ) );
|
||||
}
|
||||
|
||||
check_admin_referer('plugin-upload');
|
||||
|
||||
@@ -227,8 +228,9 @@ if ( isset($_GET['action']) ) {
|
||||
|
||||
} elseif ( 'upload-theme' == $action ) {
|
||||
|
||||
if ( ! current_user_can('install_themes') )
|
||||
if ( ! current_user_can( 'upload_themes' ) ) {
|
||||
wp_die( __( 'You do not have sufficient permissions to install themes on this site.' ) );
|
||||
}
|
||||
|
||||
check_admin_referer('theme-upload');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user