_wp_get_allowed_postdata( array $post_data = null )

Applies a blacklist to post data fields used in editing functions.


Parameters

$post_data

(Optional) Array of post data. Defaults to the contents of $_POST.

Default value: null


Return

(object|bool) WP_Error on failure, true on success.


Source

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


Changelog

Changelog
Version Description
WP-4.9.9 Introduced.