Welcome, visitor! Log in
 

Source View: title_save_pre

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.

  • Action hooks look like this: do_action( "hook_name" )
  • Filter hooks look like this: 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.

Source View

Line Code
18  }
19  
20  if (isset($_POST['deletepost'])) {
21  $action = "delete";
22  }
23  
24  switch($action) {
25  case 'post':
26  
27       if ( !user_can_create_draft($user_ID) )
28            die('You are not allowed to create posts or drafts on this blog.');
29  
30       $post_pingback = (int) $_POST['post_pingback'];
31       $content         = apply_filters('content_save_pre',  $_POST['content']);
32       $excerpt         = apply_filters('excerpt_save_pre',  $_POST['excerpt']);
33       $post_title      = apply_filters('title_save_pre',    $_POST['post_title']);
34       $post_categories = apply_filters('category_save_pre', $_POST['post_category']);
35       $post_status     = apply_filters('status_save_pre',   $_POST['post_status']);
36       $post_name       = apply_filters('name_save_pre',     $_POST['post_name']);
37       $post_parent = 0;
38       $menu_order  = 0;
39       
40  
41       if ( isset($_POST['parent_id']) )
42            $post_parent = (int) $_POST['parent_id'];
43  
44       if ( isset($_POST['menu_order']) )
45            $menu_order = (int) $_POST['menu_order'];
46  
47       if (! empty($_POST['post_author_override'])) {
48            $post_author = (int) $_POST['post_author_override'];