Default to keyword searches for the plugin and theme installers in case no search type is posted back. fixes #19619.
props georgestephanis, SergeyBiryukov for initial patches. git-svn-id: http://svn.automattic.com/wordpress/trunk@20639 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
57488f2a54
commit
608b26589e
|
@ -47,7 +47,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
|
|||
|
||||
switch ( $tab ) {
|
||||
case 'search':
|
||||
$type = isset( $_REQUEST['type'] ) ? stripslashes( $_REQUEST['type'] ) : '';
|
||||
$type = isset( $_REQUEST['type'] ) ? stripslashes( $_REQUEST['type'] ) : 'term';
|
||||
$term = isset( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : '';
|
||||
|
||||
switch ( $type ) {
|
||||
|
|
|
@ -59,7 +59,7 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
|
|||
|
||||
switch ( $tab ) {
|
||||
case 'search':
|
||||
$type = isset( $_REQUEST['type'] ) ? stripslashes( $_REQUEST['type'] ) : '';
|
||||
$type = isset( $_REQUEST['type'] ) ? stripslashes( $_REQUEST['type'] ) : 'term';
|
||||
switch ( $type ) {
|
||||
case 'tag':
|
||||
$args['tag'] = array_map( 'sanitize_key', $search_terms );
|
||||
|
|
|
@ -116,7 +116,7 @@ add_action('install_plugins_dashboard', 'install_dashboard');
|
|||
* @since 2.7.0
|
||||
*/
|
||||
function install_search_form( $type_selector = true ) {
|
||||
$type = isset($_REQUEST['type']) ? stripslashes( $_REQUEST['type'] ) : '';
|
||||
$type = isset($_REQUEST['type']) ? stripslashes( $_REQUEST['type'] ) : 'term';
|
||||
$term = isset($_REQUEST['s']) ? stripslashes( $_REQUEST['s'] ) : '';
|
||||
|
||||
?><form id="search-plugins" method="get" action="">
|
||||
|
|
|
@ -50,7 +50,7 @@ function install_themes_feature_list( ) {
|
|||
* @since 2.8.0
|
||||
*/
|
||||
function install_theme_search_form( $type_selector = true ) {
|
||||
$type = isset( $_REQUEST['type'] ) ? stripslashes( $_REQUEST['type'] ) : '';
|
||||
$type = isset( $_REQUEST['type'] ) ? stripslashes( $_REQUEST['type'] ) : 'term';
|
||||
$term = isset( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : '';
|
||||
if ( ! $type_selector )
|
||||
echo '<p class="install-help">' . __( 'Search for themes by keyword.' ) . '</p>';
|
||||
|
|
Loading…
Reference in New Issue