Make WordPress Core

Changeset 36302


Ignore:
Timestamp:
01/14/2016 08:05:06 PM (9 years ago)
Author:
swissspidy
Message:

Allow searching for 0 throughout the admin.

Fixes #31025.

Location:
trunk/src/wp-admin
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-comments.php

    r35549 r36302  
    192192}
    193193
    194 if ( isset($_REQUEST['s']) && $_REQUEST['s'] ) {
     194if ( isset($_REQUEST['s']) && strlen( $_REQUEST['s'] ) ) {
    195195    echo '<span class="subtitle">';
    196196    /* translators: %s: search keywords */
  • trunk/src/wp-admin/edit-tags.php

    r35875 r36302  
    312312<div class="wrap nosubsub">
    313313<h1><?php echo esc_html( $title );
    314 if ( !empty($_REQUEST['s']) )
    315     printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( wp_unslash($_REQUEST['s']) ) ); ?>
     314if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
     315    /* translators: %s: search keywords */
     316    printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( wp_unslash( $_REQUEST['s'] ) ) );
     317}
     318?>
    316319</h1>
    317320
  • trunk/src/wp-admin/edit.php

    r35376 r36302  
    304304if ( current_user_can( $post_type_object->cap->create_posts ) )
    305305    echo ' <a href="' . esc_url( admin_url( $post_new_file ) ) . '" class="page-title-action">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
    306 if ( ! empty( $_REQUEST['s'] ) )
    307     printf( ' <span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', get_search_query() );
     306
     307if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
     308    /* translators: %s: search keywords */
     309    printf( ' <span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', get_search_query() );
     310}
    308311?></h1>
    309312
  • trunk/src/wp-admin/includes/class-wp-plugins-list-table.php

    r36301 r36302  
    7676        global $status, $plugins, $totals, $page, $orderby, $order, $s;
    7777
    78         wp_reset_vars( array( 'orderby', 'order', 's' ) );
     78        wp_reset_vars( array( 'orderby', 'order' ) );
    7979
    8080        /**
     
    225225        }
    226226
    227         if ( $s ) {
     227        if ( strlen( $s ) ) {
    228228            $status = 'search';
    229229            $plugins['search'] = array_filter( $plugins['all'], array( $this, '_search_callback' ) );
     
    269269
    270270    /**
    271      * @staticvar string $term
     271     * @global string $s
     272     *
    272273     * @param array $plugin
    273274     * @return bool
    274275     */
    275276    public function _search_callback( $plugin ) {
    276         static $term = null;
    277         if ( is_null( $term ) )
    278             $term = wp_unslash( $_REQUEST['s'] );
     277        global $s;
    279278
    280279        foreach ( $plugin as $value ) {
    281             if ( is_string( $value ) && false !== stripos( strip_tags( $value ), $term ) ) {
     280            if ( is_string( $value ) && false !== stripos( strip_tags( $value ), $s ) ) {
    282281                return true;
    283282            }
  • trunk/src/wp-admin/link-manager.php

    r34891 r36302  
    7575<div class="wrap nosubsub">
    7676<h1><?php echo esc_html( $title ); ?> <a href="link-add.php" class="page-title-action"><?php echo esc_html_x('Add New', 'link'); ?></a> <?php
    77 if ( !empty($_REQUEST['s']) )
    78     printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( wp_unslash($_REQUEST['s']) ) ); ?>
     77if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
     78    /* translators: %s: search keywords */
     79    printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( wp_unslash( $_REQUEST['s'] ) ) );
     80}
     81?>
    7982</h1>
    8083
  • trunk/src/wp-admin/network/sites.php

    r35917 r36302  
    289289<?php endif; ?>
    290290
    291 <?php if ( isset( $_REQUEST['s'] ) && $_REQUEST['s'] ) {
     291<?php
     292if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
     293    /* translators: %s: search keywords */
    292294    printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $s ) );
    293295} ?>
  • trunk/src/wp-admin/network/themes.php

    r35997 r36302  
    240240<div class="wrap">
    241241<h1><?php echo esc_html( $title ); if ( current_user_can('install_themes') ) { ?> <a href="theme-install.php" class="page-title-action"><?php echo esc_html_x('Add New', 'theme'); ?></a><?php }
    242 if ( $s )
    243     printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( $s ) ); ?>
     242if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
     243    /* translators: %s: search keywords */
     244    printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $s ) );
     245}
     246?>
    244247</h1>
    245248
  • trunk/src/wp-admin/network/users.php

    r34891 r36302  
    213213    endif;
    214214
    215     if ( !empty( $usersearch ) )
    216     printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $usersearch ) );
     215    if ( strlen( $usersearch ) ) {
     216        /* translators: %s: search keywords */
     217        printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $usersearch ) );
     218    }
    217219    ?>
    218220    </h1>
  • trunk/src/wp-admin/plugins.php

    r35997 r36302  
    482482if ( ( ! is_multisite() || is_network_admin() ) && current_user_can('install_plugins') ) { ?>
    483483 <a href="<?php echo self_admin_url( 'plugin-install.php' ); ?>" class="page-title-action"><?php echo esc_html_x('Add New', 'plugin'); ?></a>
    484 <?php }
    485 if ( $s )
    486     printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( $s ) ); ?>
     484<?php
     485}
     486
     487if ( strlen( $s ) ) {
     488    /* translators: %s: search keywords */
     489    printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $s ) );
     490}
     491?>
    487492</h1>
    488493
  • trunk/src/wp-admin/upload.php

    r34891 r36302  
    221221    <a href="media-new.php" class="page-title-action"><?php echo esc_html_x('Add New', 'file'); ?></a><?php
    222222}
    223 if ( ! empty( $_REQUEST['s'] ) )
    224     printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', get_search_query() ); ?>
     223if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
     224    /* translators: %s: search keywords */
     225    printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', get_search_query() );
     226}
     227?>
    225228</h1>
    226229
  • trunk/src/wp-admin/users.php

    r36068 r36302  
    482482<?php }
    483483
    484 if ( $usersearch )
    485     printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( $usersearch ) ); ?>
     484if ( strlen( $usersearch ) ) {
     485    /* translators: %s: search keywords */
     486    printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $usersearch ) );
     487}
     488?>
    486489</h1>
    487490
Note: See TracChangeset for help on using the changeset viewer.