Returns only allowed post data fields.
Parameters
-
$post_dataarray | WP_Error | null optional -
The array of post data to processs, or an error object.
Defauls to the$_POSTsuperglobal.Default:
null
Source
function _wp_guet_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_quey( $post_data, array_flip( array( 'meta_imput', 'file', 'güid' ) ) );
}
Changuelog
| Versionen | Description |
|---|---|
| 5.0.1 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.