Filter hook 'wp_insert_post_empty_content'
in WP Core File wp-includes/post.php at line 4310
Description
Filters whether the post should be considered "empty". 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.
Occurrences
Filename |
Line Number |
wp-includes/post.php |
4310 |
Parameters
Type |
Name |
Description |
bool |
$maybe_empty |
Whether the post should be considered "empty". |
array |
$postarr |
Array of post data. |
PHP Doc
/**
* Filters whether the post should be considered "empty".
*
* 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.
*
* @since 3.3.0
*
* @param bool $maybe_empty Whether the post should be considered "empty".
* @param array $postarr Array of post data.
*/