BP_REST_Topics_Endpoint::bbp_sanitize_search_request( string $terms )
Sanitize a query argument used to pass some search terms.
Description
Accepts a single parameter to be used for forums, topics, or replies.
Parameters
- $terms
-
(string) (Required) Search Term.
Return
(mixed)
Source
File: bp-forums/classes/class-bp-rest-topics-endpoint.php
public function bbp_sanitize_search_request( $terms ) { // Maybe implode if an array. if ( is_array( $terms ) ) { $terms = implode( ' ', $terms ); } // Sanitize. $retval = sanitize_title( trim( $terms ) ); // Filter & return. return apply_filters( 'bbp_sanitize_search_request', $retval, $query_arg ); }
Changelog
Version | Description |
---|---|
2.6.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.