Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: content_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.

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

Source View

This hook occurs 2 times in this file.

Line Code
2073                          break;
2074                     default:
2075                          return(new IXR_Error(401, __("Invalid post type.")));
2076                          break;
2077                }
2078                $post_author = $content_struct["wp_author_id"];
2079           }
2080
2081           $post_title = $content_struct['title'];
2082           $post_content = apply_filters( 'content_save_pre', $content_struct['description'] );
2083
2084           $post_status = $publish ? 'publish' : 'draft';
2085
2086           if( isset( $content_struct["{$post_type}_status"] ) ) {
2087                switch( $content_struct["{$post_type}_status"] ) {
2088                     case 'draft':
2089                     case 'private':
2090                     case 'publish':
2091                          $post_status = $content_struct["{$post_type}_status"];
 
Line Code
2440                               break;
2441                          default:
2442                               $ping_status = get_option("default_ping_status");
2443                               break;
2444                     }
2445                }
2446           }
2447
2448           $post_title = $content_struct['title'];
2449           $post_content = apply_filters( 'content_save_pre', $content_struct['description'] );
2450           $catnames = $content_struct['categories'];
2451
2452           $post_category = array();
2453
2454           if (is_array($catnames)) {
2455                foreach ($catnames as $cat) {
2456                      $post_category[] = get_cat_ID($cat);
2457                }
2458           }