Make WordPress Core


Ignore:
Timestamp:
04/16/2016 04:42:48 PM (8 years ago)
Author:
afercia
Message:

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

Props Ipstenu, ericlewis, michaelarestad.

Fixes #35429.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/plugin-install.php

    r34891 r37221  
    107107        if ( $tab === 'upload' ) {
    108108            $href = self_admin_url( 'plugin-install.php' );
    109             $text = _x( 'Browse', 'plugins' );
     109            $upload_tab_class = ' upload-tab';
    110110        } else {
    111111            $href = self_admin_url( 'plugin-install.php?tab=upload' );
    112             $text = __( 'Upload Plugin' );
     112            $upload_tab_class = '';
    113113        }
    114         echo ' <a href="' . $href . '" class="upload page-title-action">' . $text . '</a>';
     114
     115        printf( ' <a href="%s" class="upload-view-toggle page-title-action%s"><span class="upload">%s</span><span class="browse">%s</span></a>',
     116            $href,
     117            $upload_tab_class,
     118            __( 'Upload Plugin' ),
     119            __( 'Browse Plugins' )
     120        );
    115121    }
    116122    ?>
    117123</h1>
     124
     125<div class="upload-plugin-wrap<?php echo $upload_tab_class; ?>">
     126<?php
     127/*
     128 * Output the upload plugin form on every plugin install screen, so it can be
     129 * displayed via JavaScript rather then opening up the devoted upload plugin page.
     130 */
     131install_plugins_upload(); ?>
     132</div>
    118133
    119134<?php
Note: See TracChangeset for help on using the changeset viewer.