From aaa11d6207a0825ce18793d5d942ddbf276c0dd5 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Thu, 14 Jan 2016 20:06:25 +0000 Subject: [PATCH] Allow searching for `0` throughout the admin. Fixes #31025. Built from https://develop.svn.wordpress.org/trunk@36302 git-svn-id: http://core.svn.wordpress.org/trunk@36269 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit-comments.php | 2 +- wp-admin/edit-tags.php | 7 +++++-- wp-admin/edit.php | 7 +++++-- wp-admin/includes/class-wp-plugins-list-table.php | 13 ++++++------- wp-admin/link-manager.php | 7 +++++-- wp-admin/network/sites.php | 4 +++- wp-admin/network/themes.php | 7 +++++-- wp-admin/network/users.php | 6 ++++-- wp-admin/plugins.php | 11 ++++++++--- wp-admin/upload.php | 7 +++++-- wp-admin/users.php | 7 +++++-- wp-includes/version.php | 2 +- 12 files changed, 53 insertions(+), 27 deletions(-) diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index fc105feb36..f5448ab349 100644 --- a/wp-admin/edit-comments.php +++ b/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/wp-admin/edit-tags.php b/wp-admin/edit-tags.php index 846928caa8..713c8b9472 100644 --- a/wp-admin/edit-tags.php +++ b/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/wp-admin/edit.php b/wp-admin/edit.php index 62c70e2bc3..27d8f6895b 100644 --- a/wp-admin/edit.php +++ b/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/wp-admin/network/themes.php b/wp-admin/network/themes.php index af22af1efe..29dd9e5b57 100644 --- a/wp-admin/network/themes.php +++ b/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/wp-admin/plugins.php b/wp-admin/plugins.php index 176f294e47..a55001e253 100644 --- a/wp-admin/plugins.php +++ b/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(); ?> diff --git a/wp-includes/version.php b/wp-includes/version.php index 7fbbd41e1b..30d98b652b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5-alpha-36301'; +$wp_version = '4.5-alpha-36302'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.