WP_Post::filter() WordPress Method
The WP_Post::filter() method is used to filter post data before it is updated in the database. This is useful for ensuring that data is sanitized before it is stored in the database.
WP_Post::filter( string $filter ) #
{@Missing Summary}
Parameters
- $filter
(string)(Required)Filter.
Return
(WP_Post)
Source
File: wp-includes/class-wp-post.php
public function filter( $filter ) { if ( $this->filter === $filter ) { return $this; } if ( 'raw' === $filter ) { return self::get_instance( $this->ID ); } return sanitize_post( $this, $filter ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
3.5.0 | Introduced. |