ACF_Form_Post::wp_insert_post_empty_contentpublicACF 5.0.1

wp_insert_post_empty_content

Allows WP to insert a new post without title or post_content if ACF data exists.

Method of the class: ACF_Form_Post{}

No Hooks.

Returns

true|false.

Usage

$ACF_Form_Post = new ACF_Form_Post();
$ACF_Form_Post->wp_insert_post_empty_content( $maybe_empty, $postarr );
$maybe_empty(true|false) (required)
Whether the post should be considered "empty".
$postarr(array) (required)
Array of post data.

Changelog

Since 5.0.1 Introduced.

ACF_Form_Post::wp_insert_post_empty_content() code ACF 6.8.8

function wp_insert_post_empty_content( $maybe_empty, $postarr ) {

	// return false and allow insert if '_acf_changed' exists
	if ( $maybe_empty && acf_maybe_get_POST( '_acf_changed' ) ) {
		return false;
	}

	// return
	return $maybe_empty;
}