WP_Term::filter() WordPress Method
The WordPress WP_Term::filter() method is used to filter a given array of terms by a specified taxonomy. This is useful for narrowing down a list of terms to those that are relevant to a particular taxonomy.
WP_Term::filter( string $filter ) #
Sanitizes term fields, according to the filter type provided.
Parameters
- $filter
(string)(Required)Filter context. Accepts 'edit', 'db', 'display', 'attribute', 'js', 'rss', or 'raw'.
Source
File: wp-includes/class-wp-term.php
public function filter( $filter ) { sanitize_term( $this, $this->taxonomy, $filter ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.4.0 | Introduced. |