_wp_get_allowed_postdata( array $post_data = null )
Returns only allowed post data fields
Description Description
Parameters Parameters
- $post_data
-
(array) (Optional) Array of post data. Defaults to the contents of $_POST.
Default value: null
Return Return
(object|bool) WP_Error on failure, true on success.
Source Source
File: wp-admin/includes/post.php
206 207 208 209 210 211 212 213 214 215 216 217 | function _wp_get_allowed_postdata( $post_data = null ) { if ( empty ( $post_data ) ) { $post_data = $_POST ; } // Pass through errors if ( is_wp_error( $post_data ) ) { return $post_data ; } return array_diff_key ( $post_data , array_flip ( array ( 'meta_input' , 'file' , 'guid' ) ) ); } |
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
5.0.1 | Introduced. |