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
511        }
512
513        $user = set_current_user(0, $user_login);
514        if ( !current_user_can('publish_posts') )
515          return new IXR_Error(401, 'Sorry, you can not post on this weblog or category.');
516
517        $post_author = $user->ID;
518
519        $post_title = $content_struct['title'];
520        $post_content = apply_filters( 'content_save_pre', $content_struct['description'] );
521        $post_status = $publish ? 'publish' : 'draft';
522
523        $post_excerpt = $content_struct['mt_excerpt'];
524        $post_more = $content_struct['mt_text_more'];
525
526        $comment_status = (empty($content_struct['mt_allow_comments'])) ?
527          get_option('default_comment_status')
528          : $content_struct['mt_allow_comments'];
529
 
Line Code
608        set_current_user(0, $user_login);
609        if ( !current_user_can('edit_post', $post_ID) )
610          return new IXR_Error(401, 'Sorry, you can not edit this post.');
611
612        $postdata = wp_get_single_post($post_ID, ARRAY_A);
613        extract($postdata);
614           $this->escape($postdata);
615
616        $post_title = $content_struct['title'];
617        $post_content = apply_filters( 'content_save_pre', $content_struct['description'] );
618        $catnames = $content_struct['categories'];
619
620        $post_category = array();
621
622        if (is_array($catnames)) {
623          foreach ($catnames as $cat) {
624            $post_category[] = get_cat_ID($cat);
625          }
626        }