WordPress.org

Make WordPress Core

Ticket #35429: 35429.2.diff

File 35429.2.diff, 7.4 KB (added by afercia, 2 years ago)
  • src/wp-admin/css/themes.css

     
    10711071.theme-install-php a.browse-themes {
    10721072        cursor: pointer;
    10731073}
     1074
     1075.upload-browse {
     1076        color: #0073aa;
     1077        cursor: pointer;
     1078}
     1079
     1080.upload-browse:focus {
     1081        color: #124964;
     1082}
     1083
     1084.upload-browse:active {
     1085        color: #00a0d2;
     1086}
     1087
    10741088.theme-install-php a.browse-themes,
    1075 .theme-install-php.show-upload-theme a.upload {
     1089.theme-install-php.show-upload-theme a.upload,
     1090.plugin-install-php .upload-plugin,
     1091.plugin-install-php .upload-browse .browse,
     1092.plugin-install-php.show-upload-plugin .upload-browse .upload {
    10761093        display: none;
    10771094}
    1078 .theme-install-php.show-upload-theme a.browse-themes {
     1095
     1096.theme-install-php.show-upload-theme a.browse-themes,
     1097.plugin-install-php.show-upload-plugin .upload-browse .browse {
    10791098        display: inline;
    10801099}
     1100
    10811101.upload-theme,
    10821102.upload-plugin {
    10831103        -webkit-box-sizing: border-box;
     
    10911111        position: relative;
    10921112        top: 10px;
    10931113}
     1114
    10941115body.show-upload-theme .upload-theme,
    1095 .upload-plugin {
     1116.show-upload-plugin .upload-plugin,
     1117.upload-plugin-wrap.upload-tab .upload-plugin {
    10961118        display: block;
    10971119}
     1120
    10981121.upload-theme .wp-upload-form,
    10991122.upload-plugin .wp-upload-form {
    11001123        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/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 via the Upload button in the upper left.' ), 'https://wordpress.org/plugins/' ); ?></p>
    214214
    215215        <?php display_plugins_table(); ?>
    216216
  • src/wp-admin/js/updates.js

     
    454454                $message.html( $message.data( 'originaltext' ) );
    455455                wp.a11y.speak( wp.updates.l10n.updateCancel );
    456456        };
     457
    457458        /**
    458459         * Potentially add an AYS to a user attempting to leave the page
    459460         *
     
    462463         *
    463464         * @since 4.2.0
    464465         */
    465 
    466466        wp.updates.beforeunload = function() {
    467467                if ( wp.updates.updateLock ) {
    468468                        return wp.updates.l10n.beforeunload;
     
    469469                }
    470470        };
    471471
     472        /**
     473         * Show or hide the plugin uploader and update the Upload/Browse button.
     474         *
     475         * @since 4.5.0
     476         */
     477        wp.updates.showUploader = function() {
     478                $( '.upload-browse' ).on( 'click', function() {
     479                        var $body = $( 'body' );
     480                        $body.toggleClass( 'show-upload-plugin' );
     481                        $( this ).attr( 'aria-expanded', $body.hasClass( 'show-upload-plugin' ) );
     482                });
     483        };
    472484
    473485        $( document ).ready( function() {
    474486                /*
     
    508520                        $( this ).parents( 'form' ).find( '#private_key, #public_key' ).parents( 'label' ).toggle( ( 'ssh' == $( this ).val() ) );
    509521                }).change();
    510522
     523                // Allow the uploader to show on click.
     524                wp.updates.showUploader();
     525
    511526                // Click handler for plugin updates in List Table view.
    512527                $( '.plugin-update-tr' ).on( 'click', '.update-link', function( e ) {
    513528                        e.preventDefault();
  • 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                        $text = $text_browse = _x( 'Browse', 'plugins' );
     110                        $text_upload = '';
     111                        $upload_plugin_wrap_class = ' upload-tab';
    110112                } else {
    111113                        $href = self_admin_url( 'plugin-install.php?tab=upload' );
    112                         $text = __( 'Upload Plugin' );
     114                        $text = $text_upload = __( 'Upload Plugin' );
     115                        $text_browse = _x( 'Browse', 'plugins' );
     116                        $upload_plugin_wrap_class = '';
    113117                }
    114                 echo ' <a href="' . $href . '" class="upload page-title-action">' . $text . '</a>';
     118                echo ' <a href="' . $href . '" class="upload page-title-action hide-if-js">' . $text . '</a>' .
     119                        '<button type="button" class="upload-browse page-title-action hide-if-no-js" aria-expanded="false">' .
     120                        '<span class="upload">' . $text_upload . '</span>' .
     121                        '<span class="browse">' . $text_browse . '</span>' .
     122                        '</button>';
    115123        }
    116124        ?>
    117125</h1>
    118126
     127<div class="upload-plugin-wrap<?php echo $upload_plugin_wrap_class; ?>">
     128<?php install_plugins_upload(); ?>
     129</div>
     130
    119131<?php
    120132if ( $tab !== 'upload' ) {
    121133        $wp_list_table->views();
  • 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(