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
1450                          break;
1451                     default:
1452                          return(new IXR_Error(401, __("Invalid post type.")));
1453                          break;
1454                }
1455                $post_author = $content_struct["wp_author_id"];
1456           }
1457
1458           $post_title = $content_struct['title'];
1459           $post_content = apply_filters( 'content_save_pre', $content_struct['description'] );
1460
1461           $post_status = $publish ? 'publish' : 'draft';
1462
1463           if( isset( $content_struct["{$post_type}_status"] ) ) {
1464                switch( $content_struct["{$post_type}_status"] ) {
1465                     case 'draft':
1466                     case 'private':
1467                     case 'publish':
1468                          $post_status = $content_struct["{$post_type}_status"];
 
Line Code
1778                               break;
1779                          default:
1780                               $ping_status = get_option("default_ping_status");
1781                               break;
1782                     }
1783                }
1784           }
1785
1786           $post_title = $content_struct['title'];
1787           $post_content = apply_filters( 'content_save_pre', $content_struct['description'] );
1788           $catnames = $content_struct['categories'];
1789
1790           $post_category = array();
1791
1792           if (is_array($catnames)) {
1793                foreach ($catnames as $cat) {
1794                      $post_category[] = get_cat_ID($cat);
1795                }
1796           }