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_settings('default_comment_status')
528          : $content_struct['mt_allow_comments'];
529
 
Line Code
595        set_current_user(0, $user_login);
596        if ( !current_user_can('edit_post', $post_ID) )
597          return new IXR_Error(401, 'Sorry, you can not edit this post.');
598
599        $postdata = wp_get_single_post($post_ID, ARRAY_A);
600           $this->escape($postdata);
601           extract($postdata, EXTR_SKIP);
602
603        $post_title = $content_struct['title'];
604        $post_content = apply_filters( 'content_save_pre', $content_struct['description'] );
605        $catnames = $content_struct['categories'];
606
607        $post_category = array();
608           
609        if (is_array($catnames)) {
610          foreach ($catnames as $cat) {
611            $post_category[] = get_cat_ID($cat);
612          }
613        }