apply_filters( ‘wp_insert_post_empty_content’, bool $maybe_empty, array $postarr )

In this article

Filters whether the post should be considered “empty”.

Description

The post is considered "empty" if both:

  1. The post type supports the title, editor, and excerpt fields
  2. The title, editor, and excerpt fields are all empty

Returning a truthy value from the filter will effectively short-circuit the new post being inserted and return 0. If $wp_error is true, a WP_Error will be returned instead.

Parameters

$maybe_emptybool
Whether the post should be considered "empty".
$postarrarray
Array of post data.

Source

if ( apply_filters( 'wp_insert_post_empty_content', $maybe_empty, $postarr ) ) {

Changelog

VersionDescription
3.3.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.