Make WordPress Core

Changeset 9074


Ignore:
Timestamp:
10/03/2008 03:06:43 AM (16 years ago)
Author:
ryan
Message:

Function to prep 's' for display on admin pages that don't run WP_Query(). Props Viper007Bond. see #7552

Location:
trunk/wp-admin
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/categories.php

    r9073 r9074  
    144144<p class="search-box">
    145145    <label class="hidden" for="post-search-input"><?php _e('Search Categories'); ?>:</label>
    146     <input type="text" class="search-input" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" />
     146    <input type="text" class="search-input" id="post-search-input" name="s" value="<?php _admin_search_query(); ?>" />
    147147    <input type="submit" value="<?php _e( 'Search Categories' ); ?>" class="button" />
    148148</p>
  • trunk/wp-admin/edit-comments.php

    r9073 r9074  
    177177<p class="search-box">
    178178    <label class="hidden" for="post-search-input"><?php _e( 'Search Comments' ); ?>:</label>
    179     <input type="text" class="search-input" id="post-search-input" name="s" value="<?php echo $search; ?>" />
     179    <input type="text" class="search-input" id="post-search-input" name="s" value="<?php _admin_search_query(); ?>" />
    180180    <input type="submit" value="<?php _e( 'Search Comments' ); ?>" class="button" />
    181181</p>
  • trunk/wp-admin/edit-link-categories.php

    r9073 r9074  
    8080<p class="search-box">
    8181    <label class="hidden" for="post-search-input"><?php _e( 'Search Categories' ); ?>:</label>
    82     <input type="text" class="search-input" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" />
     82    <input type="text" class="search-input" id="post-search-input" name="s" value="<?php _admin_search_query(); ?>" />
    8383    <input type="submit" value="<?php _e( 'Search Categories' ); ?>" class="button" />
    8484</p>
  • trunk/wp-admin/edit-pages.php

    r9073 r9074  
    166166<p class="search-box">
    167167    <label class="hidden" for="post-search-input"><?php _e( 'Search Pages' ); ?>:</label>
    168     <input type="text" class="search-input" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" />
     168    <input type="text" class="search-input" id="post-search-input" name="s" value="<?php _admin_search_query(); ?>" />
    169169    <input type="submit" value="<?php _e( 'Search Pages' ); ?>" class="button" />
    170170</p>
  • trunk/wp-admin/edit-tags.php

    r9073 r9074  
    147147<p class="search-box">
    148148    <label class="hidden" for="post-search-input"><?php _e( 'Search Tags' ); ?>:</label>
    149     <input type="text" class="search-input" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" />
     149    <input type="text" class="search-input" id="post-search-input" name="s" value="<?php _admin_search_query(); ?>" />
    150150    <input type="submit" value="<?php _e( 'Search Tags' ); ?>" class="button" />
    151151</p>
  • trunk/wp-admin/includes/template.php

    r9058 r9074  
    29792979}
    29802980
     2981/**
     2982 * Display the search query.
     2983 *
     2984 * A simple wrapper to display the "s" parameter in a GET URI. This function
     2985 * should only be used when {@link the_search_query()} cannot.
     2986 *
     2987 * @uses attribute_escape
     2988 * @since 2.7.0
     2989 *
     2990 */
     2991function _admin_search_query() {
     2992    echo ( isset($_GET['s']) ) ? attribute_escape( stripslashes( $_GET['s'] ) ) : '';
     2993}
     2994
    29812995?>
  • trunk/wp-admin/link-manager.php

    r9073 r9074  
    125125<p class="search-box">
    126126    <label class="hidden" for="post-search-input"><?php _e( 'Search Links' ); ?>:</label>
    127     <input type="text" class="search-input" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" />
     127    <input type="text" class="search-input" id="post-search-input" name="s" value="<?php _admin_search_query(); ?>" />
    128128    <input type="submit" value="<?php _e( 'Search Links' ); ?>" class="button" />
    129129</p>
Note: See TracChangeset for help on using the changeset viewer.