Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_insert_post_empty_content

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
2739           $guid = get_post_field( 'guid', $post_ID );
2740           $previous_status = get_post_field('post_status', $ID);
2741      } else {
2742           $previous_status = 'new';
2743      }
2744
2745      $maybe_empty = ! $post_content && ! $post_title && ! $post_excerpt && post_type_supports( $post_type, 'editor' )
2746           && post_type_supports( $post_type, 'title' ) && post_type_supports( $post_type, 'excerpt' );
2747
2748      if ( apply_filters( 'wp_insert_post_empty_content', $maybe_empty, $postarr ) ) {
2749           if ( $wp_error )
2750                return new WP_Error( 'empty_content', __( 'Content, title, and excerpt are empty.' ) );
2751           else
2752                return 0;
2753      }
2754
2755      if ( empty($post_type) )
2756           $post_type = 'post';
2757