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.
This hook occurs 2 times in this file.
| Line | Code |
|---|---|
| 28 | $editing = true; |
| 29 | |
| 30 | switch($action) { |
| 31 | case 'post': |
| 32 | |
| 33 | if ( !user_can_create_draft($user_ID) ) |
| 34 | die( __('You are not allowed to create posts or drafts on this blog.') ); |
| 35 | |
| 36 | $post_pingback = (int) $_POST['post_pingback']; |
| 37 | $content = apply_filters('content_save_pre', $_POST['content']); |
| 38 | $excerpt = apply_filters('excerpt_save_pre', $_POST['excerpt']); |
| 39 | $post_title = apply_filters('title_save_pre', $_POST['post_title']); |
| 40 | $post_categories = apply_filters('category_save_pre', $_POST['post_category']); |
| 41 | $post_status = apply_filters('status_save_pre', $_POST['post_status']); |
| 42 | $post_name = apply_filters('name_save_pre', $_POST['post_name']); |
| 43 | $post_parent = 0; |
| 44 | $menu_order = 0; |
| 45 | |
| 46 | |
| Line | Code |
| 273 | $blog_ID = 1; |
| 274 | } |
| 275 | $post_ID = (int) $_POST['post_ID']; |
| 276 | |
| 277 | if (!user_can_edit_post($user_ID, $post_ID, $blog_ID)) |
| 278 | die( __('You are not allowed to edit this post.') ); |
| 279 | |
| 280 | $post_categories = $_POST['post_category']; |
| 281 | if (!$post_categories) $post_categories[] = 1; |
| 282 | $content = apply_filters('content_save_pre', $_POST['content']); |
| 283 | $excerpt = apply_filters('excerpt_save_pre', $_POST['excerpt']); |
| 284 | $post_title = $_POST['post_title']; |
| 285 | $prev_status = $_POST['prev_status']; |
| 286 | $post_status = $_POST['post_status']; |
| 287 | $menu_order = (int) $_POST['menu_order']; |
| 288 | if (! empty($_POST['post_author_override'])) { |
| 289 | $post_author = (int) $_POST['post_author_override']; |
| 290 | } else if (! empty($_POST['post_author'])) { |
| 291 | $post_author = (int) $_POST['post_author']; |