sanitize_post_field
sanitize_post_field ( $field, $value, $post_id, $context = 'display' )
Parameters:- (string) field The Post Object field name.
- (mixed) value The Post Object value.
- (int) post_id Post ID.
- (string) context Optional. How to sanitize the field. Possible values are 'raw', 'edit', 'db', 'display', 'attribute' and 'js'. Default 'display'.
Returns:Defined at:Change Log: - Introduced in WordPress: 2.3.0
- Deprecated in WordPress: —
Description
Sanitizes a post field based on context.Possible context values are: 'raw', 'edit', 'db', 'display', 'attribute' and
'js'. The 'display' context is used by default. 'attribute' and 'js' contexts
are treated like 'display' when calling filters.