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.
4523*4524* @since 3.3.04525*4526* @param bool$maybe_empty Whether the post should be considered "empty".4527* @param array$postarrArray of post data.4528*/4529if(apply_filters('wp_insert_post_empty_content',$maybe_empty,$postarr)){4530if($wp_error){4531returnnewWP_Error('empty_content',__('Content, title, and excerpt are empty.'));4532}else{4533return0;4534}4535}
History
Introduced in 3.3.0. Unchanged from 6.7.7 through 7.1.0.