WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
| Line | Code |
|---|---|
| 2720 | if ( !empty($ID) ) { |
| 2721 | $update = true; |
| 2722 | $previous_status = get_post_field('post_status', $ID); |
| 2723 | } else { |
| 2724 | $previous_status = 'new'; |
| 2725 | } |
| 2726 | |
| 2727 | $maybe_empty = ! $post_content && ! $post_title && ! $post_excerpt && post_type_supports( $post_type, 'editor' ) |
| 2728 | && post_type_supports( $post_type, 'title' ) && post_type_supports( $post_type, 'excerpt' ); |
| 2729 | if ( apply_filters( 'wp_insert_post_empty_content', $maybe_empty, $postarr ) ) { |
| 2730 | if ( $wp_error ) |
| 2731 | return new WP_Error( 'empty_content', __( 'Content, title, and excerpt are empty.' ) ); |
| 2732 | else |
| 2733 | return 0; |
| 2734 | } |
| 2735 | |
| 2736 | if ( empty($post_type) ) |
| 2737 | $post_type = 'post'; |
| 2738 | |