wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



_wp_get_allowed_postdata › WordPress Function

Da5.0.1
Deprecaton/a
› _wp_get_allowed_postdata ( $post_data = null )
Parametri:
  • (array|WP_Error|null) $post_data The array of post data to process, or an error object. Defaults to the `$_POST` superglobal.
    Richiesto: No
    Default: null
Ritorna:
  • (array|WP_Error) Array of post data on success, WP_Error on failure.
Definito a:
Codex:

Returns only allowed post data fields.



Sorgenti

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