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', or 'display'. 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

Sanitize 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_meta, sanitize_user

Top Google Results

User discussions

wpseek mobile