WP_Query::is_search(): bool
Determines whether the query is for a search.
Return
bool Whether the query is for a search.
Source
File: wp-includes/class-wp-query.php
.
View all references
public function is_search() {
return (bool) $this->is_search;
}
Changelog
Version | Description |
---|---|
3.1.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.
Top ↑
Feedback
This is not ideal, as it will override existing post types being searched. Better option is to adjust the
exclude_from_search
parameter when registering the post type or via theregister_post_type_args
filter. — By crstauf —