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 44cfcf4..cb5e780 100644
|
|
function wp_ajax_search_plugins() { |
3802 | 3802 | |
3803 | 3803 | ob_start(); |
3804 | 3804 | $wp_list_table->display(); |
| 3805 | $status['count'] = count( $wp_list_table->items ); |
3805 | 3806 | $status['items'] = ob_get_clean(); |
3806 | 3807 | |
3807 | 3808 | 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 39d70e2..1cf6bb5 100644
|
|
class WP_Plugins_List_Table extends WP_List_Table { |
342 | 342 | } |
343 | 343 | |
344 | 344 | /** |
| 345 | * Display the search box. |
| 346 | * |
| 347 | * @since 3.1.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 053aabc..d38ded3 100644
|
|
|
1590 | 1590 | $( function() { |
1591 | 1591 | var $pluginFilter = $( '#plugin-filter' ), |
1592 | 1592 | $bulkActionForm = $( '#bulk-action-form' ), |
1593 | | $filesystemModal = $( '#request-filesystem-credentials-dialog' ); |
| 1593 | $filesystemModal = $( '#request-filesystem-credentials-dialog' ), |
| 1594 | $pluginSearch = $( '.plugins-php .wp-filter-search' ); |
1594 | 1595 | |
1595 | 1596 | /* |
1596 | 1597 | * Whether a user needs to submit filesystem credentials. |
… |
… |
|
1978 | 1979 | * |
1979 | 1980 | * @since 4.6.0 |
1980 | 1981 | */ |
1981 | | $( 'input.wp-filter-search, .wp-filter input[name="s"]' ).on( 'keyup search', _.debounce( function() { |
| 1982 | $( '.plugin-install-php .wp-filter-search' ).on( 'keyup search', _.debounce( function() { |
1982 | 1983 | var $form = $( '#plugin-filter' ).empty(), |
1983 | 1984 | data = _.extend( { |
1984 | 1985 | _ajax_nonce: wp.updates.ajaxNonce, |
… |
… |
|
1993 | 1994 | wp.updates.searchTerm = data.s; |
1994 | 1995 | } |
1995 | 1996 | |
1996 | | history.pushState( null, '', location.href.split( '?' )[0] + '?' + $.param( _.omit( data, '_ajax_nonce' ) ) ); |
| 1997 | if ( history.pushState ) { |
| 1998 | history.pushState( null, '', location.href.split( '?' )[ 0 ] + '?' + $.param( _.omit( data, '_ajax_nonce' ) ) ); |
| 1999 | } |
1997 | 2000 | |
1998 | 2001 | if ( 'undefined' !== typeof wp.updates.searchRequest ) { |
1999 | 2002 | wp.updates.searchRequest.abort(); |
… |
… |
|
2007 | 2010 | } ); |
2008 | 2011 | }, 500 ) ); |
2009 | 2012 | |
| 2013 | if ( $pluginSearch.length > 0 ) { |
| 2014 | $pluginSearch.attr( 'aria-describedby', 'live-search-desc' ); |
| 2015 | } |
| 2016 | |
2010 | 2017 | /** |
2011 | 2018 | * Handles changes to the plugin search box on the Installed Plugins screen, |
2012 | 2019 | * searching the plugin list dynamically. |
2013 | 2020 | * |
2014 | 2021 | * @since 4.6.0 |
2015 | 2022 | */ |
2016 | | $( '#plugin-search-input' ).on( 'keyup search', _.debounce( function() { |
| 2023 | $pluginSearch.on( 'keyup search', _.debounce( function() { |
2017 | 2024 | var data = { |
2018 | 2025 | _ajax_nonce: wp.updates.ajaxNonce, |
2019 | 2026 | s: $( '<p />' ).html( $( this ).val() ).text() |
… |
… |
|
2025 | 2032 | wp.updates.searchTerm = data.s; |
2026 | 2033 | } |
2027 | 2034 | |
2028 | | history.pushState( null, '', location.href.split( '?' )[0] + '?s=' + data.s ); |
| 2035 | if ( history.pushState ) { |
| 2036 | history.pushState( null, '', location.href.split( '?' )[ 0 ] + '?s=' + data.s ); |
| 2037 | } |
2029 | 2038 | |
2030 | 2039 | if ( 'undefined' !== typeof wp.updates.searchRequest ) { |
2031 | 2040 | wp.updates.searchRequest.abort(); |
… |
… |
|
2051 | 2060 | $( 'body' ).removeClass( 'loading-content' ); |
2052 | 2061 | $bulkActionForm.append( response.items ); |
2053 | 2062 | delete wp.updates.searchRequest; |
| 2063 | |
| 2064 | if ( 0 === response.count ) { |
| 2065 | wp.a11y.speak( wp.updates.l10n.noPluginsFound ); |
| 2066 | } else { |
| 2067 | wp.a11y.speak( wp.updates.l10n.pluginsFound.replace( '%d', response.count ) ); |
| 2068 | } |
2054 | 2069 | } ); |
2055 | 2070 | }, 500 ) ); |
2056 | 2071 | |
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 = { |