Filters whether the post should be considered "empty".
Description
The post is considered "empty" if both: <ol> <li>The post type supports the title, editor, and excerpt fields</li> <li>The title, editor, and excerpt fields are all empty</li> </ol> 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.
4597*4598* @since 3.3.04599*4600* @param bool$maybe_empty Whether the post should be considered "empty".4601* @param array$postarrArray of post data.4602*/4603if(apply_filters('wp_insert_post_empty_content',$maybe_empty,$postarr)){4604if($wp_error){4605returnnewWP_Error('empty_content',__('Content, title, and excerpt are empty.'));4606}else{4607return0;4608}4609}
History
Introduced in 3.3.0. Unchanged from 6.7.7 through 7.1.0.