diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index 112a21aae..3a510f47b 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -220,15 +220,7 @@ if ( isset($_REQUEST['approved']) || isset($_REQUEST['deleted']) || isset($_REQU
-has_items() ) : ?> - - - - +search_box( __( 'Search Comments' ), 'comment' ); ?> diff --git a/wp-admin/edit-tags.php b/wp-admin/edit-tags.php index 9f002a6eb..a2fa7ce8a 100644 --- a/wp-admin/edit-tags.php +++ b/wp-admin/edit-tags.php @@ -237,11 +237,9 @@ endif; ?> - + +search_box( $tax->labels->search_items, 'tag' ); ?> +

diff --git a/wp-admin/edit.php b/wp-admin/edit.php index fc796c51d..5e0154f80 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -242,15 +242,7 @@ $_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated'
-has_items() ) : ?> - - - - +search_box( $post_type_object->labels->search_items, 'post' ); ?> diff --git a/wp-admin/includes/class-wp-list-table.php b/wp-admin/includes/class-wp-list-table.php index 078a011e9..146cce65e 100644 --- a/wp-admin/includes/class-wp-list-table.php +++ b/wp-admin/includes/class-wp-list-table.php @@ -178,6 +178,30 @@ class WP_List_Table { _e( 'No items found.' ); } + /** + * Display the search box. + * + * @since 3.1.0 + * @access public + * + * @param string $text The search button text + * @param string $input_id The search input id + */ + function search_box( $text, $input_id ) { + if ( empty( $_REQUEST['s'] ) && !$this->has_items() ) + return; + + $input_id = $input_id . '-search-input'; + +?> + + link ) with the list * of views available on this table. diff --git a/wp-admin/link-manager.php b/wp-admin/link-manager.php index 4b1829a4c..b219b09ca 100644 --- a/wp-admin/link-manager.php +++ b/wp-admin/link-manager.php @@ -76,15 +76,7 @@ if ( isset($_REQUEST['deleted']) ) { -has_items() ) : ?> - - - - +search_box( __( 'Search Links' ), 'link' ); ?> display(); ?> diff --git a/wp-admin/network/site-themes.php b/wp-admin/network/site-themes.php index bcdbf0b48..792712aa4 100644 --- a/wp-admin/network/site-themes.php +++ b/wp-admin/network/site-themes.php @@ -152,11 +152,7 @@ if ( isset( $_GET['update'] ) ) {

- +search_box( __( 'Search Installed Themes' ), 'theme' ); ?>
views(); ?> @@ -170,4 +166,4 @@ if ( isset( $_GET['update'] ) ) { - \ No newline at end of file + diff --git a/wp-admin/network/site-users.php b/wp-admin/network/site-users.php index 41381e93c..0b2cb4669 100644 --- a/wp-admin/network/site-users.php +++ b/wp-admin/network/site-users.php @@ -211,11 +211,7 @@ if ( isset($_GET['update']) ) : endif; ?>
- +search_box( __( 'Search Users' ), 'user' ); ?>
views(); ?> @@ -301,4 +297,4 @@ endif; ?>
diff --git a/wp-admin/network/themes.php b/wp-admin/network/themes.php index b0e10e1c2..28adaabf8 100644 --- a/wp-admin/network/themes.php +++ b/wp-admin/network/themes.php @@ -94,11 +94,7 @@ require_once(ABSPATH . 'wp-admin/admin-header.php');

- +search_box( __( 'Search Installed Themes' ), 'theme' ); ?>
views(); ?> @@ -113,4 +109,4 @@ require_once(ABSPATH . 'wp-admin/admin-header.php'); views(); ?>
- + search_box( __( 'Search Users' ), 'user' ); ?>
@@ -90,4 +87,4 @@ if ( isset( $_REQUEST['updated'] ) && $_REQUEST['updated'] == 'true' && ! empty(
- \ No newline at end of file + diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php index bedb2015f..8b366c6cb 100644 --- a/wp-admin/plugins.php +++ b/wp-admin/plugins.php @@ -377,15 +377,7 @@ if ( ( ! is_multisite() || is_network_admin() ) && current_user_can('install_plu
-has_items() ) : ?> - - - - +search_box( __( 'Search Plugins' ), 'plugin' ); ?> diff --git a/wp-admin/themes.php b/wp-admin/themes.php index 67efc6595..9658c9b97 100644 --- a/wp-admin/themes.php +++ b/wp-admin/themes.php @@ -146,7 +146,7 @@ if ( ! current_user_can( 'switch_themes' ) ) {

-has_items() ) : ?> +has_items() ) : ?> diff --git a/wp-admin/upload.php b/wp-admin/upload.php index db0c8e2d3..26946948e 100644 --- a/wp-admin/upload.php +++ b/wp-admin/upload.php @@ -206,15 +206,7 @@ if ( !empty($message) ) { ?> -has_items() ) : ?> - - - - +search_box( __( 'Search Media' ), 'media' ); ?> display(); ?> diff --git a/wp-admin/users.php b/wp-admin/users.php index 61ba94217..84c9605cb 100644 --- a/wp-admin/users.php +++ b/wp-admin/users.php @@ -357,15 +357,7 @@ if ( $usersearch ) -has_items() ) : ?> - - - - +search_box( __( 'Search Users' ), 'user' ); ?> display(); ?>