From cc6fe1179d1bd51be472038567df690d9aba7062 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Thu, 14 Jan 2016 20:05:06 +0000 Subject: [PATCH] Allow searching for `0` throughout the admin. Fixes #31025. git-svn-id: https://develop.svn.wordpress.org/trunk@36302 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/edit-comments.php | 2 +- src/wp-admin/edit-tags.php | 7 +++++-- src/wp-admin/edit.php | 7 +++++-- .../includes/class-wp-plugins-list-table.php | 13 ++++++------- src/wp-admin/link-manager.php | 7 +++++-- src/wp-admin/network/sites.php | 4 +++- src/wp-admin/network/themes.php | 7 +++++-- src/wp-admin/network/users.php | 6 ++++-- src/wp-admin/plugins.php | 11 ++++++++--- src/wp-admin/upload.php | 7 +++++-- src/wp-admin/users.php | 7 +++++-- 11 files changed, 52 insertions(+), 26 deletions(-) diff --git a/src/wp-admin/edit-comments.php b/src/wp-admin/edit-comments.php index fc105feb36..f5448ab349 100644 --- a/src/wp-admin/edit-comments.php +++ b/src/wp-admin/edit-comments.php @@ -191,7 +191,7 @@ if ( $post_id ) { _e( 'Comments' ); } -if ( isset($_REQUEST['s']) && $_REQUEST['s'] ) { +if ( isset($_REQUEST['s']) && strlen( $_REQUEST['s'] ) ) { echo ''; /* translators: %s: search keywords */ printf( __( 'Search results for “%s”' ), diff --git a/src/wp-admin/edit-tags.php b/src/wp-admin/edit-tags.php index 846928caa8..713c8b9472 100644 --- a/src/wp-admin/edit-tags.php +++ b/src/wp-admin/edit-tags.php @@ -311,8 +311,11 @@ if ( is_plugin_active( 'wpcat2tag-importer/wpcat2tag-importer.php' ) ) {

' . __('Search results for “%s”') . '', esc_html( wp_unslash($_REQUEST['s']) ) ); ?> +if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) { + /* translators: %s: search keywords */ + printf( '' . __( 'Search results for “%s”' ) . '', esc_html( wp_unslash( $_REQUEST['s'] ) ) ); +} +?>

diff --git a/src/wp-admin/edit.php b/src/wp-admin/edit.php index 62c70e2bc3..27d8f6895b 100644 --- a/src/wp-admin/edit.php +++ b/src/wp-admin/edit.php @@ -303,8 +303,11 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' ); echo esc_html( $post_type_object->labels->name ); if ( current_user_can( $post_type_object->cap->create_posts ) ) echo ' ' . esc_html( $post_type_object->labels->add_new ) . ''; -if ( ! empty( $_REQUEST['s'] ) ) - printf( ' ' . __('Search results for “%s”') . '', get_search_query() ); + +if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) { + /* translators: %s: search keywords */ + printf( ' ' . __( 'Search results for “%s”' ) . '', get_search_query() ); +} ?>

' . __('Search results for “%s”') . '', esc_html( wp_unslash($_REQUEST['s']) ) ); ?> +if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) { + /* translators: %s: search keywords */ + printf( '' . __( 'Search results for “%s”' ) . '', esc_html( wp_unslash( $_REQUEST['s'] ) ) ); +} +?>

" class="page-title-action"> -' . __( 'Search results for “%s”' ) . '', esc_html( $s ) ); } ?> diff --git a/src/wp-admin/network/themes.php b/src/wp-admin/network/themes.php index af22af1efe..29dd9e5b57 100644 --- a/src/wp-admin/network/themes.php +++ b/src/wp-admin/network/themes.php @@ -239,8 +239,11 @@ require_once(ABSPATH . 'wp-admin/admin-header.php');

' . __('Search results for “%s”') . '', esc_html( $s ) ); ?> +if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) { + /* translators: %s: search keywords */ + printf( '' . __( 'Search results for “%s”' ) . '', esc_html( $s ) ); +} +?>

" class="page-title-action">' . __( 'Search results for “%s”' ) . '', esc_html( $usersearch ) ); + if ( strlen( $usersearch ) ) { + /* translators: %s: search keywords */ + printf( '' . __( 'Search results for “%s”' ) . '', esc_html( $usersearch ) ); + } ?> diff --git a/src/wp-admin/plugins.php b/src/wp-admin/plugins.php index 176f294e47..a55001e253 100644 --- a/src/wp-admin/plugins.php +++ b/src/wp-admin/plugins.php @@ -481,9 +481,14 @@ if ( ! empty( $invalid ) ) {

-' . __('Search results for “%s”') . '', esc_html( $s ) ); ?> +' . __( 'Search results for “%s”' ) . '', esc_html( $s ) ); +} +?>

' . __('Search results for “%s”') . '', get_search_query() ); ?> +if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) { + /* translators: %s: search keywords */ + printf( '' . __( 'Search results for “%s”' ) . '', get_search_query() ); +} +?> ' . __('Search results for “%s”') . '', esc_html( $usersearch ) ); ?> +if ( strlen( $usersearch ) ) { + /* translators: %s: search keywords */ + printf( '' . __( 'Search results for “%s”' ) . '', esc_html( $usersearch ) ); +} +?> views(); ?>