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'.


Top ↑

Source

File: wp-includes/class-wp-term.php

	public function filter( $filter ) {
		sanitize_term( $this, $this->taxonomy, $filter );
	}


Top ↑

Changelog

Changelog
VersionDescription
4.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.