On this page
WP_Post::filter( string $filter ): WP_Post
{@Missing Summary}
Parameters
$filterstring Required-
Filter.
Return
Source
File: wp-includes/class-wp-post.php. View all references
public function filter( $filter ) {
if ( $this->filter === $filter ) {
return $this;
}
if ( 'raw' === $filter ) {
return self::get_instance( $this->ID );
}
return sanitize_post( $this, $filter );
}
Related
Uses
| Uses | Description |
|---|---|
| WP_Post::get_instance() wp-includes/class-wp-post.php | Retrieve WP_Post instance. |
| sanitize_post() wp-includes/post.php | Sanitizes every post field. |
Changelog
| Version | Description |
|---|---|
| 3.5.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_post/filter