WordPress at a glance
filter is not described

wp_insert_post_empty_content filter-hook . WP 3.3.0

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.


add_filter( 'wp_insert_post_empty_content', 'filter_function_name_2475', 10, 2 );
function filter_function_name_2475( $maybe_empty, $postarr ){
	// filter...

	return $maybe_empty;
Whether the post should be considered "empty".
Array of post data.

Список изменений

С версии 3.3.0 Введена.

Где вызывается хук

wp-includes/post.php 3709
if ( apply_filters( 'wp_insert_post_empty_content', $maybe_empty, $postarr ) ) {

Где используется хук в ядре WP

wp-includes/class-wp-customize-nav-menus.php 972
add_filter( 'wp_insert_post_empty_content', '__return_false', 1000 );
wp-includes/class-wp-customize-nav-menus.php 974
remove_filter( 'wp_insert_post_empty_content', '__return_false', 1000 );