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
1196                          break;
1197                     default:
1198                          return(new IXR_Error(401, __("Invalid post type.")));
1199                          break;
1200                }
1201                $post_author = $content_struct["wp_author_id"];
1202           }
1203
1204           $post_title = $content_struct['title'];
1205           $post_content = apply_filters( 'content_save_pre', $content_struct['description'] );
1206
1207           $post_status = $publish ? 'publish' : 'draft';
1208
1209           if( isset( $content_struct["{$post_type}_status"] ) ) {
1210                switch( $content_struct["{$post_type}_status"] ) {
1211                     case 'draft':
1212                     case 'private':
1213                     case 'publish':
1214                          $post_status = $content_struct["{$post_type}_status"];
 
Line Code
1515                               break;
1516                          default:
1517                               $ping_status = get_option("default_ping_status");
1518                               break;
1519                     }
1520                }
1521           }
1522
1523           $post_title = $content_struct['title'];
1524           $post_content = apply_filters( 'content_save_pre', $content_struct['description'] );
1525           $catnames = $content_struct['categories'];
1526
1527           $post_category = array();
1528
1529           if (is_array($catnames)) {
1530                foreach ($catnames as $cat) {
1531                      $post_category[] = get_cat_ID($cat);
1532                }
1533           }