WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

User:T31os/get search query

Contents

Description

Retrieve the contents of the WordPress search query variable.
It could for example be used to show a brief message whilst displaying the user's search terms, you could use the following.

Usage

You have searched for: <?php echo esc_attr( get_search_query() ); ?>

Notes

Source File

get_search_query() is located in wp-includes/general-template.php.

This article is a ROUGH DRAFT. The author is still working on this document, so please do not edit this without the author's permission. The content within this article may not yet be verified or valid. This information is subject to change.