WordPress.org

Make WordPress Core

Ticket #35429: 35429.5.diff

File 35429.5.diff, 7.9 KB (added by ericlewis, 2 years ago)
  • src/wp-admin/css/themes.css

     
    10711071.theme-install-php a.browse-themes {
    10721072        cursor: pointer;
    10731073}
     1074
    10741075.theme-install-php a.browse-themes,
    1075 .theme-install-php.show-upload-theme a.upload {
     1076.theme-install-php.show-upload-theme a.upload,
     1077.upload-browse-button .browse,
     1078.upload-browse-button.upload-tab .upload,
     1079.show-upload-plugin .upload-browse-button .upload {
    10761080        display: none;
    10771081}
    1078 .theme-install-php.show-upload-theme a.browse-themes {
     1082
     1083.theme-install-php.show-upload-theme a.browse-themes,
     1084.upload-browse-button.upload-tab .browse,
     1085.show-upload-plugin .upload-browse-button .browse {
    10791086        display: inline;
    10801087}
     1088
    10811089.upload-theme,
    10821090.upload-plugin {
    10831091        -webkit-box-sizing: border-box;
     
    10911099        position: relative;
    10921100        top: 10px;
    10931101}
     1102
    10941103body.show-upload-theme .upload-theme,
    1095 .upload-plugin {
     1104.show-upload-plugin .upload-plugin,
     1105.upload-tab .upload-plugin {
    10961106        display: block;
    10971107}
     1108
    10981109.upload-theme .wp-upload-form,
    10991110.upload-plugin .wp-upload-form {
    11001111        background: #fafafa;
  • src/wp-admin/includes/admin-filters.php

     
    6464
    6565// Plugin Install hooks.
    6666add_action( 'install_plugins_featured',               'install_dashboard' );
    67 add_action( 'install_plugins_upload',                 'install_plugins_upload' );
     67// add_action( 'install_plugins_upload',                 'install_plugins_upload' );
    6868add_action( 'install_plugins_search',                 'display_plugins_table' );
    6969add_action( 'install_plugins_popular',                'display_plugins_table' );
    7070add_action( 'install_plugins_recommended',            'display_plugins_table' );
  • src/wp-admin/includes/class-wp-upgrader-skins.php

     
    579579                        $install_actions['importers_page'] = '<a href="' . admin_url( 'import.php' ) . '" target="_parent">' . __( 'Return to Importers' ) . '</a>';
    580580                } elseif ( $this->type == 'web' ) {
    581581                        $install_actions['plugins_page'] = '<a href="' . self_admin_url( 'plugin-install.php' ) . '" target="_parent">' . __( 'Return to Plugin Installer' ) . '</a>';
     582                } elseif ( 'upload' == $this->type && 'plugins' == $from ) {
     583                        $install_actions['plugins_page'] = '<a href="' . self_admin_url( 'plugin-install.php' ) . '">' . __( 'Return to Plugin Installer' ) . '</a>';
    582584                } else {
    583585                        $install_actions['plugins_page'] = '<a href="' . self_admin_url( 'plugins.php' ) . '" target="_parent">' . __( 'Return to Plugins page' ) . '</a>';
    584586                }
  • src/wp-admin/includes/plugin-install.php

     
    210210 */
    211211function install_dashboard() {
    212212        ?>
    213         <p><?php printf( __( 'Plugins extend and expand the functionality of WordPress. You may automatically install plugins from the <a href="%1$s">WordPress Plugin Directory</a> or upload a plugin in .zip format via <a href="%2$s">this page</a>.' ), 'https://wordpress.org/plugins/', self_admin_url( 'plugin-install.php?tab=upload' ) ); ?></p>
     213        <p><?php printf( __( 'Plugins extend and expand the functionality of WordPress. You may automatically install plugins from the <a href="%1$s">WordPress Plugin Directory</a> or upload a plugin in .zip format by clicking the button at the top of this page.' ), 'https://wordpress.org/plugins/' ); ?></p>
    214214
    215215        <?php display_plugins_table(); ?>
    216216
  • src/wp-admin/js/plugin-install.js

     
    11/* global plugininstallL10n, tb_click */
    22
    3 /* Plugin Browser Thickbox related JS*/
     3/**
     4 * Functionality for the plugin install screens.
     5 */
    46var tb_position;
    57jQuery( document ).ready( function( $ ) {
    68        tb_position = function() {
     
    7072                $( '#section-holder div.section' ).hide(); // Hide 'em all.
    7173                $( '#section-' + tab ).show();
    7274        });
     75
     76        /*
     77         * When a user presses the "Upload plugin" button, show the upload form in place
     78         * rather than sending them to the devoted upload plugin page.
     79         */
     80        var uploadBrowseButton = $( '.upload-browse-button' ),
     81                $body = $( document.body );
     82        uploadBrowseButton
     83                .attr({
     84                        'role': 'button',
     85                        'aria-expanded': 'false'
     86                });
     87        uploadBrowseButton.on( 'click', function( event ) {
     88                event.preventDefault();
     89                $body.toggleClass( 'show-upload-plugin' );
     90                uploadBrowseButton.attr( 'aria-expanded', $body.hasClass( 'show-upload-plugin' ) );
     91        });
    7392});
  • src/wp-admin/plugin-install.php

     
    106106        if ( ! empty( $tabs['upload'] ) && current_user_can( 'upload_plugins' ) ) {
    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-browse-button 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                        _x( 'Browse', 'plugins' )
     120                );
    115121        }
    116122        ?>
    117123</h1>
    118124
     125<div class="upload-plugin-wrap<?php echo $upload_tab_class; ?>">
    119126<?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>
     133
     134<?php
    120135if ( $tab !== 'upload' ) {
    121136        $wp_list_table->views();
    122137        echo '<br class="clear" />';
  • src/wp-admin/plugins.php

     
    372372'content'       =>
    373373        '<p>' . __('Plugins extend and expand the functionality of WordPress. Once a plugin is installed, you may activate it or deactivate it here.') . '</p>' .
    374374        '<p>' . sprintf(
    375                 /* translators: 1: Plugin Browser/Installer URL, 2: WordPress Plugin Directory URL 3: local plugin directory */
    376                 __( 'You can find additional plugins for your site by using the <a href="%1$s">Plugin Browser/Installer</a> functionality or by browsing the <a href="%2$s" target="_blank">WordPress Plugin Directory</a> directly and installing new plugins manually. To manually install a plugin you generally just need to upload the plugin file into your %3$s directory. Once a plugin has been installed, you can activate it here.' ),
    377                 'plugin-install.php',
    378                 'https://wordpress.org/plugins/',
    379                 '<code>/wp-content/plugins</code>'
     375                /* translators: %s: WordPress Plugin Directory URL */
     376                __( 'If you would like to see more plugins to choose from, click on the &#8220;Add New&#8221; button and you will be able to browse or search for additional plugins from the <a href="%s" target="_blank">WordPress.org Plugin Directory</a>. Plugins in the WordPress.org Plugin Directory are designed and developed by third parties, and are compatible with the license WordPress uses. Oh, and they&#8217;re free!' ),
     377                'https://wordpress.org/plugins/'
    380378        ) . '</p>'
    381379) );
    382380get_current_screen()->add_help_tab( array(