Index: src/wp-admin/css/themes.css =================================================================== --- src/wp-admin/css/themes.css (revision 36527) +++ src/wp-admin/css/themes.css (working copy) @@ -1056,13 +1056,18 @@ .theme-install-php a.browse-themes { cursor: pointer; } -.theme-install-php a.browse-themes, -.theme-install-php.show-upload-theme a.upload { + +.upload-view-toggle .browse, +.upload-view-toggle.upload-tab .upload, +.show-upload-view .upload { display: none; } -.theme-install-php.show-upload-theme a.browse-themes { + +.upload-view-toggle.upload-tab .browse, +.show-upload-view .upload-view-toggle .browse { display: inline; } + .upload-theme, .upload-plugin { -webkit-box-sizing: border-box; @@ -1076,10 +1081,13 @@ position: relative; top: 10px; } -body.show-upload-theme .upload-theme, -.upload-plugin { + +.show-upload-view .upload-theme, +.show-upload-view .upload-plugin, +.upload-tab .upload-plugin { display: block; } + .upload-theme .wp-upload-form, .upload-plugin .wp-upload-form { background: #fafafa; Index: src/wp-admin/includes/admin-filters.php =================================================================== --- src/wp-admin/includes/admin-filters.php (revision 36527) +++ src/wp-admin/includes/admin-filters.php (working copy) @@ -64,7 +64,7 @@ // Plugin Install hooks. add_action( 'install_plugins_featured', 'install_dashboard' ); -add_action( 'install_plugins_upload', 'install_plugins_upload' ); +// add_action( 'install_plugins_upload', 'install_plugins_upload' ); add_action( 'install_plugins_search', 'display_plugins_table' ); add_action( 'install_plugins_popular', 'display_plugins_table' ); add_action( 'install_plugins_recommended', 'display_plugins_table' ); Index: src/wp-admin/includes/class-wp-upgrader-skins.php =================================================================== --- src/wp-admin/includes/class-wp-upgrader-skins.php (revision 36527) +++ src/wp-admin/includes/class-wp-upgrader-skins.php (working copy) @@ -579,6 +579,8 @@ $install_actions['importers_page'] = '' . __( 'Return to Importers' ) . ''; } elseif ( $this->type == 'web' ) { $install_actions['plugins_page'] = '' . __( 'Return to Plugin Installer' ) . ''; + } elseif ( 'upload' == $this->type && 'plugins' == $from ) { + $install_actions['plugins_page'] = '' . __( 'Return to Plugin Installer' ) . ''; } else { $install_actions['plugins_page'] = '' . __( 'Return to Plugins page' ) . ''; } Index: src/wp-admin/includes/plugin-install.php =================================================================== --- src/wp-admin/includes/plugin-install.php (revision 36527) +++ src/wp-admin/includes/plugin-install.php (working copy) @@ -210,7 +210,7 @@ */ function install_dashboard() { ?> -
WordPress Plugin Directory or upload a plugin in .zip format via this page.' ), 'https://wordpress.org/plugins/', self_admin_url( 'plugin-install.php?tab=upload' ) ); ?>
+WordPress Plugin Directory or upload a plugin in .zip format by clicking the button at the top of this page.' ), 'https://wordpress.org/plugins/' ); ?>
Index: src/wp-admin/js/plugin-install.js =================================================================== --- src/wp-admin/js/plugin-install.js (revision 36527) +++ src/wp-admin/js/plugin-install.js (working copy) @@ -1,6 +1,8 @@ /* global plugininstallL10n, tb_click */ -/* Plugin Browser Thickbox related JS*/ +/** + * Functionality for the plugin install screens. + */ var tb_position; jQuery( document ).ready( function( $ ) { tb_position = function() { @@ -70,4 +72,21 @@ $( '#section-holder div.section' ).hide(); // Hide 'em all. $( '#section-' + tab ).show(); }); + + /* + * When a user presses the "Upload plugin" button, show the upload form in place + * rather than sending them to the devoted upload plugin page. + */ + var uploadViewToggle = $( '.upload-view-toggle' ), + $body = $( document.body ); + uploadViewToggle + .attr({ + 'role': 'button', + 'aria-expanded': 'false' + }); + uploadViewToggle.on( 'click', function( event ) { + event.preventDefault(); + $body.toggleClass( 'show-upload-view' ); + uploadViewToggle.attr( 'aria-expanded', $body.hasClass( 'show-upload-view' ) ); + }); }); Index: src/wp-admin/js/theme.js =================================================================== --- src/wp-admin/js/theme.js (revision 36527) +++ src/wp-admin/js/theme.js (working copy) @@ -1573,17 +1573,23 @@ // in new location searchContainer: $( '.wp-filter .search-form' ), + /* + * When a user presses the "Upload theme" button, show the upload form in place + * rather than sending them to the devoted upload theme page. + */ uploader: function() { - $( 'a.upload' ).on( 'click', function( event ) { + var uploadViewToggle = $( '.upload-view-toggle' ), + $body = $( document.body ); + uploadViewToggle + .attr({ + 'role': 'button', + 'aria-expanded': 'false' + }); + uploadViewToggle.on( 'click', function( event ) { event.preventDefault(); - $( 'body' ).addClass( 'show-upload-theme' ); - themes.router.navigate( themes.router.baseUrl( '?upload' ), { replace: true } ); + $body.toggleClass( 'show-upload-view' ); + uploadViewToggle.attr( 'aria-expanded', $body.hasClass( 'show-upload-view' ) ); }); - $( 'a.browse-themes' ).on( 'click', function( event ) { - event.preventDefault(); - $( 'body' ).removeClass( 'show-upload-theme' ); - themes.router.navigate( themes.router.baseUrl( '' ), { replace: true } ); - }); }, // Toggle the full filters navigation Index: src/wp-admin/plugin-install.php =================================================================== --- src/wp-admin/plugin-install.php (revision 36527) +++ src/wp-admin/plugin-install.php (working copy) @@ -106,17 +106,32 @@ 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 ' ' . $text . ''; + + printf( ' %s%s', + $href, + $upload_tab_class, + __( 'Upload Plugin' ), + _x( 'Browse', 'plugins' ) + ); } ?> +' . __('Plugins extend and expand the functionality of WordPress. Once a plugin is installed, you may activate it or deactivate it here.') . '
' . '' . sprintf(
- /* translators: 1: Plugin Browser/Installer URL, 2: WordPress Plugin Directory URL 3: local plugin directory */
- __( 'You can find additional plugins for your site by using the Plugin Browser/Installer functionality or by browsing the WordPress Plugin Directory 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.' ),
- 'plugin-install.php',
- 'https://wordpress.org/plugins/',
- '/wp-content/plugins
'
+ /* translators: %s: WordPress Plugin Directory URL */
+ __( 'If you would like to see more plugins to choose from, click on the “Add New” button and you will be able to browse or search for additional plugins from the WordPress.org Plugin Directory. 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’re free!' ),
+ 'https://wordpress.org/plugins/'
) . '