WP_Post::filter()publicWP 3.5.0

{@Missing Summary}

Method of the class: WP_Post{}

No Hooks.

Return

WP_Post.

Usage

$WP_Post = new WP_Post();
$WP_Post->filter( $filter );
$filter(string) (required)
Filter.

Changelog

Since 3.5.0 Introduced.

WP_Post::filter() code WP 6.6.2

public function filter( $filter ) {
	if ( $this->filter === $filter ) {
		return $this;
	}

	if ( 'raw' === $filter ) {
		return self::get_instance( $this->ID );
	}

	return sanitize_post( $this, $filter );
}