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
2076                          break;
2077                     default:
2078                          return(new IXR_Error(401, __("Invalid post type.")));
2079                          break;
2080                }
2081                $post_author = $content_struct["wp_author_id"];
2082           }
2083
2084           $post_title = $content_struct['title'];
2085           $post_content = apply_filters( 'content_save_pre', $content_struct['description'] );
2086
2087           $post_status = $publish ? 'publish' : 'draft';
2088
2089           if( isset( $content_struct["{$post_type}_status"] ) ) {
2090                switch( $content_struct["{$post_type}_status"] ) {
2091                     case 'draft':
2092                     case 'private':
2093                     case 'publish':
2094                          $post_status = $content_struct["{$post_type}_status"];
 
Line Code
2419                               break;
2420                          default:
2421                               $ping_status = get_option("default_ping_status");
2422                               break;
2423                     }
2424                }
2425           }
2426
2427           $post_title = $content_struct['title'];
2428           $post_content = apply_filters( 'content_save_pre', $content_struct['description'] );
2429           $catnames = $content_struct['categories'];
2430
2431           $post_category = array();
2432
2433           if (is_array($catnames)) {
2434                foreach ($catnames as $cat) {
2435                      $post_category[] = get_cat_ID($cat);
2436                }
2437           }