Make WordPress Core

Opened 8 hours ago

Last modified 6 hours ago

#63715 new enhancement

Ability to upload plugins directly from Plugins Menu

Reported by: presskopp's profile Presskopp Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Administration Keywords:
Focuses: administration Cc:

Description

The idea is to put another menu entry under 'Plugins' named 'Upload plugin' to get direct access to the upload modal

Change History (2)

#1 @Presskopp
8 hours ago

Patch:

add $submenu['plugins.php'][20] = array( __( 'Upload Plugin' ), 'install_plugins', 'plugin-upload.php' );

to menu.php (~ L.306)

if ( ! is_multisite() ) {
	$submenu['plugins.php'][10] = array( __( 'Add Plugin' ), 'install_plugins', 'plugin-install.php' );
	if ( wp_is_block_theme() ) {
		// Place the menu item below the Theme File Editor menu item.
		add_action( 'admin_menu', '_add_plugin_file_editor_to_tools', 101 );
	} else {
		$submenu['plugins.php'][15] = array( __( 'Plugin File Editor' ), 'edit_plugins', 'plugin-editor.php' );
	}
	$submenu['plugins.php'][20] = array( __( 'Upload Plugin' ), 'install_plugins', 'plugin-upload.php' );
}

and create a new file under wp/admin named plugin-upload.php having the following content:

<?php
require_once dirname( __FILE__ ) . '/admin.php';

if ( ! current_user_can( 'install_plugins' ) ) {
	wp_die( __( 'Sorry, you are not allowed to install plugins on this site.' ) );
}

$_REQUEST['tab'] = 'upload';

require_once ABSPATH . 'wp-admin/plugin-install.php';

#2 @La Geek
6 hours ago

Very appreciated. I've been wondering for a long time why you have to click so much for the upload interface. Great addition 💯

Note: See TracTickets for help on using tickets.