Additional plugin API hooks, extending moderation scheme to more fully cover trackbacks and pingbacks, cleanup of XML-RPC file.

git-svn-id: http://svn.automattic.com/wordpress/trunk@1012 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2004-03-25 20:18:20 +00:00
parent 8a79d5712a
commit 0c1e3856b6
4 changed files with 8 additions and 2 deletions

View File

@ -378,6 +378,7 @@ switch($action) {
pingBlogs($blog_ID); pingBlogs($blog_ID);
} // end if moving from draft/private to published } // end if moving from draft/private to published
if ($post_status == 'publish') { if ($post_status == 'publish') {
do_action('publish_post', $post_ID);
// Trackback time. // Trackback time.
$to_ping = trim($wpdb->get_var("SELECT to_ping FROM $tableposts WHERE ID = $post_ID")); $to_ping = trim($wpdb->get_var("SELECT to_ping FROM $tableposts WHERE ID = $post_ID"));
$pinged = trim($wpdb->get_var("SELECT pinged FROM $tableposts WHERE ID = $post_ID")); $pinged = trim($wpdb->get_var("SELECT pinged FROM $tableposts WHERE ID = $post_ID"));
@ -407,6 +408,7 @@ switch($action) {
$location = 'post.php'; $location = 'post.php';
} }
header ('Location: ' . $location); header ('Location: ' . $location);
do_action('edit_post', $post_ID);
break; break;
case 'delete': case 'delete':
@ -448,7 +450,7 @@ switch($action) {
$sendback = $HTTP_SERVER_VARS['HTTP_REFERER']; $sendback = $HTTP_SERVER_VARS['HTTP_REFERER'];
if (strstr($sendback, 'post.php')) $sendback = get_settings('siteurl') .'/wp-admin/post.php'; if (strstr($sendback, 'post.php')) $sendback = get_settings('siteurl') .'/wp-admin/post.php';
header ('Location: ' . $sendback); header ('Location: ' . $sendback);
do_action('delete_post', $post_ID);
break; break;
case 'editcomment': case 'editcomment':
@ -676,7 +678,7 @@ switch($action) {
$referredby = $HTTP_POST_VARS['referredby']; $referredby = $HTTP_POST_VARS['referredby'];
if (!empty($referredby)) header('Location: ' . $referredby); if (!empty($referredby)) header('Location: ' . $referredby);
else header ("Location: edit.php?p=$comment_post_ID&c=1#comments"); else header ("Location: edit.php?p=$comment_post_ID&c=1#comments");
do_action('edit_comment', $post_ID);
break; break;
default: default:

View File

@ -100,6 +100,8 @@ if ($ok) { // if there was no comment from this IP in the last 10 seconds
wp_notify_postauthor($comment_ID, 'comment'); wp_notify_postauthor($comment_ID, 'comment');
} }
do_action('comment_post', $comment_ID);
if ($email == '') if ($email == '')
$email = ' '; // this to make sure a cookie is set for 'no email' $email = ' '; // this to make sure a cookie is set for 'no email'

View File

@ -1567,6 +1567,7 @@ function get_posts($args) {
} }
function check_comment($author, $email, $url, $comment, $user_ip) { function check_comment($author, $email, $url, $comment, $user_ip) {
if (1 == get_settings('comment_moderation')) return false;
$words = explode("\n", get_settings('moderation_keys') ); $words = explode("\n", get_settings('moderation_keys') );
foreach ($words as $word) { foreach ($words as $word) {
$word = trim($word); $word = trim($word);

View File

@ -86,6 +86,7 @@ if ((strlen(''.$tb_id)) && (empty($HTTP_GET_VARS['__mode'])) && (strlen(''.$tb_u
if (get_settings('comments_notify')) if (get_settings('comments_notify'))
wp_notify_postauthor($comment_ID, 'trackback'); wp_notify_postauthor($comment_ID, 'trackback');
trackback_response(0); trackback_response(0);
do_action('trackback_post', $comment_ID);
} }
} }
?> ?>