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 |
|---|---|
| 2960 | * Returning a truthy value to the filter will effectively short-circuit |
| 2961 | * the new post being inserted, returning 0. If $wp_error is true, a WP_Error |
| 2962 | * will be returned instead. |
| 2963 | * |
| 2964 | * @since 3.3.0 |
| 2965 | * |
| 2966 | * @param bool $maybe_empty Whether the post should be considered "empty". |
| 2967 | * @param array $postarr Array of post data. |
| 2968 | */ |
| 2969 | if ( apply_filters( 'wp_insert_post_empty_content', $maybe_empty, $postarr ) ) { |
| 2970 | if ( $wp_error ) |
| 2971 | return new WP_Error( 'empty_content', __( 'Content, title, and excerpt are empty.' ) ); |
| 2972 | else |
| 2973 | return 0; |
| 2974 | } |
| 2975 | |
| 2976 | if ( empty($post_type) ) |
| 2977 | $post_type = 'post'; |
| 2978 | |