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:

Description

Sanitizes every post field.If the context is 'raw', then the post object or array will get minimal sanitization of the integer fields.

Related Functions

sanitize_post_field, sanitize_option, sanitize_term, sanitize_user, sanitize_meta

Top Google Results

User discussions

wpseek mobile