sanitize_post
sanitize_post ( $post, $context = 'display' )
Parameters:- (object|WP_Post|array) post The post object or array
- (string) context Optional. How to sanitize post fields. Accepts 'raw', 'edit', 'db', 'display', 'attribute', or 'js'. Default 'display'.
See:Returns:- (object|WP_Post|array) The now sanitized post object or array (will be the same type as `$post`).
Defined at: - Introduced in WordPress: 2.3.0
- Deprecated in WordPress: —
Description
Sanitizes every post field.If the context is 'raw', then the post object or array will get minimal
sanitization of the integer fields.