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.


git-svn-id: https://develop.svn.wordpress.org/trunk@49284 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Helen Hou-Sandi 2020-10-23 15:59:34 +00:00
parent ebe858e5a7
commit e515d61ec0
12 changed files with 14 additions and 14 deletions

View File

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

View File

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

View File

@ -339,7 +339,7 @@ if ( is_plugin_active( 'wpcat2tag-importer/wpcat2tag-importer.php' ) ) {
<?php
if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
/* 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'] ) ) {
/* 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'] ) );
/* 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.
if ( ! is_multisite() && current_user_can( 'install_plugins' ) ) {

View File

@ -105,7 +105,7 @@ echo esc_html( $title );
<?php
if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
/* 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
if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
/* 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
if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
/* 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 ) ) {
/* 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 ) ) {
/* 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'] ) ) {
/* 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 ) ) {
/* 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>' );
}
?>