Administration: Unify search results message on list tables.

This wraps the search string in a `<strong>` tag, which makes easier to parse visually especially when your search string also contains double quotes.

Props Mista-Flo, mapk, sergeybiryukov.
Fixes #37353.

Built from https://develop.svn.wordpress.org/trunk@49284


git-svn-id: http://core.svn.wordpress.org/trunk@49046 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Helen Hou-Sandí 2020-10-23 16:01:15 +00:00
parent 4847fb4263
commit e0c12cc818
14 changed files with 16 additions and 16 deletions

View File

@ -232,8 +232,8 @@ if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
echo '<span class="subtitle">'; echo '<span class="subtitle">';
printf( printf(
/* translators: %s: Search query. */ /* translators: %s: Search query. */
__( 'Search results for &#8220;%s&#8221;' ), __( 'Search results for: %s' ),
wp_html_excerpt( esc_html( wp_unslash( $_REQUEST['s'] ) ), 50, '&hellip;' ) '<strong>' . wp_html_excerpt( esc_html( wp_unslash( $_REQUEST['s'] ) ), 50, '&hellip;' . '</strong>' )
); );
echo '</span>'; echo '</span>';
} }

View File

@ -339,7 +339,7 @@ if ( is_plugin_active( 'wpcat2tag-importer/wpcat2tag-importer.php' ) ) {
<?php <?php
if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) { if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
/* translators: %s: Search query. */ /* translators: %s: Search query. */
printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( wp_unslash( $_REQUEST['s'] ) ) ); printf( '<span class="subtitle">' . __( 'Search results for: %s' ) . '</span>', '<strong>' . esc_html( wp_unslash( $_REQUEST['s'] ) ) . '</strong>' );
} }
?> ?>

View File

@ -407,7 +407,7 @@ if ( current_user_can( $post_type_object->cap->create_posts ) ) {
if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) { if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
/* translators: %s: Search query. */ /* translators: %s: Search query. */
printf( ' <span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', get_search_query() ); printf( ' <span class="subtitle">' . __( 'Search results for: %s' ) . '</span>', '<strong>' . get_search_query() . '</strong>' );
} }
?> ?>

View File

@ -407,7 +407,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
$s = esc_html( wp_unslash( $_REQUEST['s'] ) ); $s = esc_html( wp_unslash( $_REQUEST['s'] ) );
/* translators: %s: Plugin search term. */ /* translators: %s: Plugin search term. */
printf( __( 'No plugins found for &#8220;%s&#8221;.' ), $s ); printf( __( 'No plugins found for: %s.' ), '<strong>' . $s . '</strong>' );
// We assume that somebody who can install plugins in multisite is experienced enough to not need this helper link. // We assume that somebody who can install plugins in multisite is experienced enough to not need this helper link.
if ( ! is_multisite() && current_user_can( 'install_plugins' ) ) { if ( ! is_multisite() && current_user_can( 'install_plugins' ) ) {

View File

@ -2580,8 +2580,8 @@
var $subTitle = $( '<span />' ).addClass( 'subtitle' ).html( var $subTitle = $( '<span />' ).addClass( 'subtitle' ).html(
sprintf( sprintf(
/* translators: %s: Search query. */ /* translators: %s: Search query. */
__( 'Search results for &#8220;%s&#8221;' ), __( 'Search results for: %s' ),
_.escape( data.s ) '<strong>' + _.escape( data.s ) + '</strong>'
) ), ) ),
$oldSubTitle = $( '.wrap .subtitle' ); $oldSubTitle = $( '.wrap .subtitle' );

File diff suppressed because one or more lines are too long

View File

@ -105,7 +105,7 @@ echo esc_html( $title );
<?php <?php
if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) { if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
/* translators: %s: Search query. */ /* translators: %s: Search query. */
printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( wp_unslash( $_REQUEST['s'] ) ) ); printf( '<span class="subtitle">' . __( 'Search results for: %s' ) . '</span>', '<strong>' . esc_html( wp_unslash( $_REQUEST['s'] ) ) . '</strong>' );
} }
?> ?>

View File

@ -372,7 +372,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
<?php <?php
if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) { if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
/* translators: %s: Search query. */ /* translators: %s: Search query. */
printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $s ) ); printf( '<span class="subtitle">' . __( 'Search results for: %s' ) . '</span>', '<strong>' . esc_html( $s ) . '</strong>' );
} }
?> ?>

View File

@ -353,7 +353,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
<?php <?php
if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) { if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
/* translators: %s: Search query. */ /* translators: %s: Search query. */
printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $s ) ); printf( '<span class="subtitle">' . __( 'Search results for: %s' ) . '</span>', '<strong>' . esc_html( $s ) . '</strong>' );
} }
?> ?>

View File

@ -279,7 +279,7 @@ if ( isset( $_REQUEST['updated'] ) && 'true' == $_REQUEST['updated'] && ! empty(
if ( strlen( $usersearch ) ) { if ( strlen( $usersearch ) ) {
/* translators: %s: Search query. */ /* translators: %s: Search query. */
printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $usersearch ) ); printf( '<span class="subtitle">' . __( 'Search results for: %s' ) . '</span>', '<strong>' . esc_html( $usersearch ) . '</strong>' );
} }
?> ?>

View File

@ -728,7 +728,7 @@ if ( ( ! is_multisite() || is_network_admin() ) && current_user_can( 'install_pl
if ( strlen( $s ) ) { if ( strlen( $s ) ) {
/* translators: %s: Search query. */ /* translators: %s: Search query. */
printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( urldecode( $s ) ) ); printf( '<span class="subtitle">' . __( 'Search results for: %s' ) . '</span>', '<strong>' . esc_html( urldecode( $s ) ) . '</strong>' );
} }
?> ?>

View File

@ -276,7 +276,7 @@ if ( current_user_can( 'upload_files' ) ) {
if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) { if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
/* translators: %s: Search query. */ /* translators: %s: Search query. */
printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', get_search_query() ); printf( '<span class="subtitle">' . __( 'Search results for: %s' ) . '</span>', '<strong>' . get_search_query() . '</strong>' );
} }
?> ?>

View File

@ -571,7 +571,7 @@ switch ( $wp_list_table->current_action() ) {
if ( strlen( $usersearch ) ) { if ( strlen( $usersearch ) ) {
/* translators: %s: Search query. */ /* translators: %s: Search query. */
printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $usersearch ) ); printf( '<span class="subtitle">' . __( 'Search results for: %s' ) . '</span>', '<strong>' . esc_html( $usersearch ) . '</strong>' );
} }
?> ?>

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.6-beta1-49283'; $wp_version = '5.6-beta1-49284';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.