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.
4473*4474* @since 3.3.04475*4476* @param bool$maybe_empty Whether the post should be considered "empty".4477* @param array$postarrArray of post data.4478*/4479if(apply_filters('wp_insert_post_empty_content',$maybe_empty,$postarr)){4480if($wp_error){4481returnnewWP_Error('empty_content',__('Content, title, and excerpt are empty.'));4482}else{4483return0;4484}4485}
History
Introduced in 3.3.0. Unchanged from 6.7.7 through 7.1.0.