Uses
Uses | Description |
---|---|
wp-includes/load.php: is_wp_error() | Check whether variable is a WordPress Error. |
Returns only allowed post data fields
(array) (Optional) Array of post data. Defaults to the contents of $_POST.
Default value: null
(array|WP_Error) Array of post data on success, WP_Error on failure.
File: wp-admin/includes/post.php
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' ) ) ); }
Version | Description |
---|---|
5.0.1 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/_wp_get_allowed_postdata