• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress core a2z

WordPress core a2z

WordPress core only

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / _wp_get_allowed_postdata() – Returns only allowed post data fields

You appear to be a bot. Output may be restricted

Description

Returns only allowed post data fields

Usage

$array|WP_Error = _wp_get_allowed_postdata( $post_data );

Parameters

$post_data
( array ) optional – Array of post data. Defaults to the contents of $_POST.

Returns

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

Source

File name: wordpress/wp-admin/includes/post.php
Lines:

1 to 12 of 12
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' ) ) );
}
 

 View on GitHub View on Trac

Published: 25th November 2019 | Last updated: 2nd April 2020

Primary Sidebar

Information

Function name: _wp_get_allowed_postdata
Plugin ref: WordPress
Version: 5.6
Sourcefile: wp-admin/includes/post.php
File ref: wp-admin/includes/post.php
API type: private
Deprecated?: No
API Letters: _,A,G,P,W

Footer

WP-a2z
WordPress core a2z
WordPress core only
WordPress 5.6
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  core.wp-a2z.org
© Copyright WP-a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites