Plugin Install: show the upload form in place rather than sending users to the devoted upload plugin page.

Props Ipstenu, ericlewis, michaelarestad.

Fixes #35429.

git-svn-id: https://develop.svn.wordpress.org/trunk@37221 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrea Fercia
2016-04-16 16:42:48 +00:00
parent 745018d81a
commit e4b26366e4
9 changed files with 75 additions and 28 deletions

View File

@@ -106,16 +106,31 @@ include(ABSPATH . 'wp-admin/admin-header.php');
if ( ! empty( $tabs['upload'] ) && current_user_can( 'upload_plugins' ) ) {
if ( $tab === 'upload' ) {
$href = self_admin_url( 'plugin-install.php' );
$text = _x( 'Browse', 'plugins' );
$upload_tab_class = ' upload-tab';
} else {
$href = self_admin_url( 'plugin-install.php?tab=upload' );
$text = __( 'Upload Plugin' );
$upload_tab_class = '';
}
echo ' <a href="' . $href . '" class="upload page-title-action">' . $text . '</a>';
printf( ' <a href="%s" class="upload-view-toggle page-title-action%s"><span class="upload">%s</span><span class="browse">%s</span></a>',
$href,
$upload_tab_class,
__( 'Upload Plugin' ),
__( 'Browse Plugins' )
);
}
?>
</h1>
<div class="upload-plugin-wrap<?php echo $upload_tab_class; ?>">
<?php
/*
* Output the upload plugin form on every plugin install screen, so it can be
* displayed via JavaScript rather then opening up the devoted upload plugin page.
*/
install_plugins_upload(); ?>
</div>
<?php
if ( $tab !== 'upload' ) {
$wp_list_table->views();