sanitize_post()
Sanitize every post field.
If the context is 'raw', then the post object or array will get minimal sanitization of the integer fields.
Uses: sanitize_post_field()
1 time — 0.000089 sec (very fast) | 50000 times — 3.16 sec (fast)
No Hooks.
Return
Object|WP_Post|Array
. The now sanitized post object or array (will be the same type as $post).
Usage
sanitize_post( $post, $context );
- $post(object|WP_Post|array) (required)
- The post object or array
- $context(string)
- How to sanitize post fields. Accepts 'raw', 'edit', 'db', 'display', 'attribute', or 'js'.
Default: 'display'
Notes
Changelog
Since 2.3.0 | Introduced. |