WordPress at Your Fingertips
function is not described

_wp_get_allowed_postdata() WP 5.0.1

Returns only allowed post data fields

This is an internal function for using it by WP core itself. It's not recommended to use this function in your code.

No Hooks.


Array|WP_Error. Array of post data on success, WP_Error on failure.


_wp_get_allowed_postdata( $post_data );
Array of post data.
Default: contents of $_POST


Since 5.0.1 Introduced.

Code of _wp_get_allowed_postdata() WP 5.8.2

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' ) ) );