diff --git src/wp-admin/css/forms.css src/wp-admin/css/forms.css
index f219831..15be606 100644
|
|
p.search-box { |
564 | 564 | margin: 0 4px 0 0; |
565 | 565 | } |
566 | 566 | |
| 567 | .js.plugins-php .search-box .wp-filter-search { |
| 568 | margin: 0; |
| 569 | width: 280px; |
| 570 | font-size: 16px; |
| 571 | font-weight: 300; |
| 572 | line-height: 1.5; |
| 573 | padding: 3px 5px; |
| 574 | height: 32px; |
| 575 | } |
| 576 | |
567 | 577 | input[type="text"].ui-autocomplete-loading, |
568 | 578 | input[type="email"].ui-autocomplete-loading { |
569 | 579 | background-image: url(../images/loading.gif); |
diff --git src/wp-admin/includes/ajax-actions.php src/wp-admin/includes/ajax-actions.php
index c16f338..5e04365 100644
|
|
function wp_ajax_search_plugins() { |
3810 | 3810 | |
3811 | 3811 | ob_start(); |
3812 | 3812 | $wp_list_table->display(); |
| 3813 | $status['count'] = count( $wp_list_table->items ); |
3813 | 3814 | $status['items'] = ob_get_clean(); |
3814 | 3815 | |
3815 | 3816 | wp_send_json_success( $status ); |
diff --git src/wp-admin/includes/class-wp-plugins-list-table.php src/wp-admin/includes/class-wp-plugins-list-table.php
index c36b77f..ddc1ad2 100644
|
|
class WP_Plugins_List_Table extends WP_List_Table { |
342 | 342 | } |
343 | 343 | |
344 | 344 | /** |
| 345 | * Display the search box. |
| 346 | * |
| 347 | * @since 4.6.0 |
| 348 | * @access public |
| 349 | * |
| 350 | * @param string $text The search button text |
| 351 | * @param string $input_id The search input id |
| 352 | */ |
| 353 | public function search_box( $text, $input_id ) { |
| 354 | if ( empty( $_REQUEST['s'] ) && ! $this->has_items() ) { |
| 355 | return; |
| 356 | } |
| 357 | |
| 358 | $input_id = $input_id . '-search-input'; |
| 359 | |
| 360 | if ( ! empty( $_REQUEST['orderby'] ) ) { |
| 361 | echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />'; |
| 362 | } |
| 363 | if ( ! empty( $_REQUEST['order'] ) ) { |
| 364 | echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />'; |
| 365 | } |
| 366 | ?> |
| 367 | <p class="search-box"> |
| 368 | <label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label> |
| 369 | <input type="search" id="<?php echo $input_id ?>" class="wp-filter-search" name="s" value="<?php _admin_search_query(); ?>" placeholder="<?php echo esc_attr( 'Search installed plugins...' ); ?>"/> |
| 370 | <input type="submit" id="search-submit" class="button hide-if-js" value="<?php echo esc_attr( $text ); ?>"> |
| 371 | </p> |
| 372 | <?php |
| 373 | } |
| 374 | |
| 375 | /** |
345 | 376 | * |
346 | 377 | * @global string $status |
347 | 378 | * @return array |
diff --git src/wp-admin/js/updates.js src/wp-admin/js/updates.js
index c97c0bb..0de60b5 100644
|
|
|
1584 | 1584 | $( function() { |
1585 | 1585 | var $pluginFilter = $( '#plugin-filter' ), |
1586 | 1586 | $bulkActionForm = $( '#bulk-action-form' ), |
1587 | | $filesystemModal = $( '#request-filesystem-credentials-dialog' ); |
| 1587 | $filesystemModal = $( '#request-filesystem-credentials-dialog' ), |
| 1588 | $pluginSearch = $( '.plugins-php .wp-filter-search' ); |
1588 | 1589 | |
1589 | 1590 | /* |
1590 | 1591 | * Whether a user needs to submit filesystem credentials. |
… |
… |
|
1972 | 1973 | * |
1973 | 1974 | * @since 4.6.0 |
1974 | 1975 | */ |
1975 | | $( 'input.wp-filter-search, .wp-filter input[name="s"]' ).on( 'keyup search', _.debounce( function() { |
| 1976 | $( '.plugin-install-php .wp-filter-search' ).on( 'keyup search', _.debounce( function() { |
1976 | 1977 | var $form = $( '#plugin-filter' ).empty(), |
1977 | 1978 | data = _.extend( { |
1978 | 1979 | _ajax_nonce: wp.updates.ajaxNonce, |
… |
… |
|
1987 | 1988 | wp.updates.searchTerm = data.s; |
1988 | 1989 | } |
1989 | 1990 | |
1990 | | history.pushState( null, '', location.href.split( '?' )[0] + '?' + $.param( _.omit( data, '_ajax_nonce' ) ) ); |
| 1991 | if ( history.pushState ) { |
| 1992 | history.pushState( null, '', location.href.split( '?' )[ 0 ] + '?' + $.param( _.omit( data, '_ajax_nonce' ) ) ); |
| 1993 | } |
1991 | 1994 | |
1992 | 1995 | if ( 'undefined' !== typeof wp.updates.searchRequest ) { |
1993 | 1996 | wp.updates.searchRequest.abort(); |
… |
… |
|
2001 | 2004 | } ); |
2002 | 2005 | }, 500 ) ); |
2003 | 2006 | |
| 2007 | if ( $pluginSearch.length > 0 ) { |
| 2008 | $pluginSearch.attr( 'aria-describedby', 'live-search-desc' ); |
| 2009 | } |
| 2010 | |
2004 | 2011 | /** |
2005 | 2012 | * Handles changes to the plugin search box on the Installed Plugins screen, |
2006 | 2013 | * searching the plugin list dynamically. |
2007 | 2014 | * |
2008 | 2015 | * @since 4.6.0 |
2009 | 2016 | */ |
2010 | | $( '#plugin-search-input' ).on( 'keyup search', _.debounce( function() { |
| 2017 | $pluginSearch.on( 'keyup input', _.debounce( function( event ) { |
2011 | 2018 | var data = { |
2012 | 2019 | _ajax_nonce: wp.updates.ajaxNonce, |
2013 | | s: $( '<p />' ).html( $( this ).val() ).text() |
| 2020 | s: event.target.value |
2014 | 2021 | }; |
2015 | 2022 | |
| 2023 | // Clear on escape. |
| 2024 | if ( 'keyup' === event.type && 27 === event.which ) { |
| 2025 | event.target.value = ''; |
| 2026 | } |
| 2027 | |
2016 | 2028 | if ( wp.updates.searchTerm === data.s ) { |
2017 | 2029 | return; |
2018 | 2030 | } else { |
2019 | 2031 | wp.updates.searchTerm = data.s; |
2020 | 2032 | } |
2021 | 2033 | |
2022 | | history.pushState( null, '', location.href.split( '?' )[0] + '?s=' + data.s ); |
| 2034 | if ( history.pushState ) { |
| 2035 | history.pushState( null, '', location.href.split( '?' )[ 0 ] + '?s=' + data.s ); |
| 2036 | } |
2023 | 2037 | |
2024 | 2038 | if ( 'undefined' !== typeof wp.updates.searchRequest ) { |
2025 | 2039 | wp.updates.searchRequest.abort(); |
… |
… |
|
2045 | 2059 | $( 'body' ).removeClass( 'loading-content' ); |
2046 | 2060 | $bulkActionForm.append( response.items ); |
2047 | 2061 | delete wp.updates.searchRequest; |
| 2062 | |
| 2063 | if ( 0 === response.count ) { |
| 2064 | wp.a11y.speak( wp.updates.l10n.noPluginsFound ); |
| 2065 | } else { |
| 2066 | wp.a11y.speak( wp.updates.l10n.pluginsFound.replace( '%d', response.count ) ); |
| 2067 | } |
2048 | 2068 | } ); |
2049 | 2069 | }, 500 ) ); |
2050 | 2070 | |
diff --git src/wp-admin/plugins.php src/wp-admin/plugins.php
index 6010784..fd90515 100644
|
|
get_current_screen()->add_help_tab( array( |
371 | 371 | 'title' => __('Overview'), |
372 | 372 | 'content' => |
373 | 373 | '<p>' . __('Plugins extend and expand the functionality of WordPress. Once a plugin is installed, you may activate it or deactivate it here.') . '</p>' . |
| 374 | '<p>' . __( 'The search for installed plugins will search for terms in their name, description, or author.' ) . ' <span id="live-search-desc" class="hide-if-no-js">' . __( 'The search results will be updated as you type.' ) . '</span></p>' . |
374 | 375 | '<p>' . sprintf( |
375 | 376 | /* translators: %s: WordPress Plugin Directory URL */ |
376 | 377 | __( '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 <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’re free!' ), |
diff --git src/wp-includes/script-loader.php src/wp-includes/script-loader.php
index 3b1e8fa..2945b48 100644
|
|
function wp_default_scripts( &$scripts ) { |
653 | 653 | 'activateTheme' => is_network_admin() ? __( 'Network Enable' ) : __( 'Activate' ), |
654 | 654 | 'activateImporter' => __( 'Activate importer' ), |
655 | 655 | 'unknownError' => __( 'An unknown error occured' ), |
| 656 | 'pluginsFound' => __( 'Number of plugins found: %d' ), |
| 657 | 'noPluginsFound' => __( 'No plugins found. Try a different search.' ), |
656 | 658 | ), |
657 | 659 | ) ); |
658 | 660 | |
diff --git tests/qunit/fixtures/updates.js tests/qunit/fixtures/updates.js
index 657ef73..d570aa6 100644
|
|
window._wpUpdatesSettings = { |
39 | 39 | 'activatePlugin': 'Activate', |
40 | 40 | 'activateTheme': 'Activate', |
41 | 41 | 'activateImporter': 'Activate importer', |
42 | | 'unknownError': 'An unknown error occured' |
| 42 | 'unknownError': 'An unknown error occured', |
| 43 | 'pluginsFound': 'Number of plugins found: %d', |
| 44 | 'noPluginsFound': 'No plugins found. Try a different search.' |
43 | 45 | } |
44 | 46 | }; |
45 | 47 | window._wpUpdatesItemCounts = { |