Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: publish_post

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

Line Code
120      $content = preg_replace("|\n([^\n])|", " $1", $content);
121      $content = addslashes(trim($content));
122
123
124      $sql = "INSERT INTO $tableposts (post_author, post_date, post_date_gmt, post_content, post_title, post_modified, post_modified_gmt) VALUES (1, '$post_date', '$post_date_gmt', '$content', '$post_title', '$post_date', '$post_date_gmt')";
125
126      $result = $wpdb->query($sql);
127      $post_ID = $wpdb->insert_id;
128
129      do_action('publish_post', $post_ID);
130      do_action('publish_phone', $post_ID);
131      pingback($content, $post_ID);
132
133      echo "\n<p><b>Posted title:</b> $post_title<br />";
134      echo "\n<b>Posted content:</b><br /><pre>".$content.'</pre></p>';
135
136 if (!$post_categories) $post_categories[] = 1;
137 foreach ($post_categories as $post_category) :
138      $post_category = intval($post_category);