diff --git a/wp-admin/categories.php b/wp-admin/categories.php index 755c976545..d663b05304 100644 --- a/wp-admin/categories.php +++ b/wp-admin/categories.php @@ -34,6 +34,7 @@ case 'addcat': $cat = intval($_POST['cat']); $wpdb->query("INSERT INTO $wpdb->categories (cat_ID, cat_name, category_nicename, category_description, category_parent) VALUES ('0', '$cat_name', '$category_nicename', '$category_description', '$cat')"); + do_action('add_category', $wpdb->insert_id); header('Location: categories.php?message=1#addcat'); break; @@ -57,6 +58,7 @@ case 'delete': $wpdb->query("UPDATE $wpdb->categories SET category_parent = '$cat_parent' WHERE category_parent = '$cat_ID'"); // TODO: Only set categories to general if they're not in another category already $wpdb->query("UPDATE $wpdb->post2cat SET category_id='1' WHERE category_id='$cat_ID'"); + do_action('delete_category', $cat_ID); header('Location: categories.php?message=2'); diff --git a/wp-admin/edit-page-form.php b/wp-admin/edit-page-form.php index cdce8d6338..c70e24f817 100644 --- a/wp-admin/edit-page-form.php +++ b/wp-admin/edit-page-form.php @@ -85,12 +85,17 @@ edCanvas = document.getElementById('content');

- - + + + + + + +

- + diff --git a/wp-admin/post.php b/wp-admin/post.php index cac9dacfec..9b6f8d1d37 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -195,10 +195,9 @@ case 'post': if ('publish' == $post_status) { do_action('publish_post', $post_ID); if ($post_pingback) - pingback($content, $post_ID); - do_enclose( $content, $post_ID ); - do_trackbacks($post_ID); - + register_shutdown_function('pingback', $content, $post_ID); + register_shutdown_function('do_enclose', $content, $post_ID ); + register_shutdown_function('do_trackbacks', $post_ID); } if ($post_status == 'static') { @@ -434,10 +433,10 @@ case 'editpost': if ($post_status == 'publish') { do_action('publish_post', $post_ID); - do_trackbacks($post_ID); - do_enclose( $content, $post_ID ); + register_shutdown_function('do_trackbacks', $post_ID); + register_shutdown_function('do_enclose', $content, $post_ID ); if ( get_option('default_pingback_flag') ) - pingback($content, $post_ID); + register_shutdown_function('pingback', $content, $post_ID); } if ($post_status == 'static') { diff --git a/wp-admin/users.php b/wp-admin/users.php index fb0fd4f8e1..6ff8f4db91 100644 --- a/wp-admin/users.php +++ b/wp-admin/users.php @@ -72,7 +72,9 @@ case 'adduser': (user_login, user_pass, user_nickname, user_email, user_ip, user_domain, user_browser, user_registered, user_level, user_idmode, user_firstname, user_lastname, user_nicename, user_url) VALUES ('$user_login', MD5('$pass1'), '$user_nickname', '$user_email', '$user_ip', '$user_domain', '$user_browser', '$now', '$new_users_can_blog', 'nickname', '$user_firstname', '$user_lastname', '$user_nicename', '$user_uri')"); - + + do_action('user_register', $wpdb->insert_id); + if ($result == false) die (__('ERROR: Couldn’t register you!')); @@ -96,7 +98,7 @@ case 'promote': header('Location: users.php'); } - $id = $_GET['id']; + $id = (int) $_GET['id']; $prom = $_GET['prom']; $user_data = get_userdata($id); @@ -108,12 +110,11 @@ case 'promote': if ('up' == $prom) { $new_level = $usertopromote_level + 1; - $sql="UPDATE $wpdb->users SET user_level=$new_level WHERE ID = $id AND $new_level < $user_level"; + $wpdb->query("UPDATE $wpdb->users SET user_level=$new_level WHERE ID = $id AND $new_level < $user_level"); } elseif ('down' == $prom) { $new_level = $usertopromote_level - 1; - $sql="UPDATE $wpdb->users SET user_level=$new_level WHERE ID = $id AND $new_level < $user_level"; + $wpdb->query("UPDATE $wpdb->users SET user_level=$new_level WHERE ID = $id AND $new_level < $user_level"); } - $result = $wpdb->query($sql); header('Location: users.php'); diff --git a/wp-includes/pluggable-functions.php b/wp-includes/pluggable-functions.php index f16bbfe66c..3910aaafb0 100644 --- a/wp-includes/pluggable-functions.php +++ b/wp-includes/pluggable-functions.php @@ -216,6 +216,10 @@ function wp_notify_postauthor($comment_id, $comment_type='') { $from = 'From: "' . $comment->comment_author . "\" <$comment->comment_author_email>"; } + $notify_message = apply_filters('comment_notification_text', $notify_message); + $subject = apply_filters('comment_notification_subject', $subject); + $message_headers = apply_filters('comment_notification_headers', $message_headers); + $message_headers = "MIME-Version: 1.0\n" . "$from\n" . "Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"\n"; @@ -240,7 +244,6 @@ function wp_notify_moderator($comment_id) { $comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID='$comment_id' LIMIT 1"); $post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID='$comment->comment_post_ID' LIMIT 1"); - $user = $wpdb->get_row("SELECT * FROM $wpdb->users WHERE ID='$post->post_author' LIMIT 1"); $comment_author_domain = gethostbyaddr($comment->comment_author_IP); $comments_waiting = $wpdb->get_var("SELECT count(comment_ID) FROM $wpdb->comments WHERE comment_approved = '0'"); @@ -260,6 +263,9 @@ function wp_notify_moderator($comment_id) { $subject = sprintf( __('[%1$s] Please moderate: "%2$s"'), get_settings('blogname'), $post->post_title ); $admin_email = get_settings("admin_email"); + $notify_message = apply_filters('comment_moderation_text', $notify_message); + $subject = apply_filters('comment_moderation_subject', $subject); + @wp_mail($admin_email, $subject, $notify_message); return true; diff --git a/wp-includes/template-functions-category.php b/wp-includes/template-functions-category.php index c28f61196f..ca1e94bd35 100644 --- a/wp-includes/template-functions-category.php +++ b/wp-includes/template-functions-category.php @@ -262,6 +262,8 @@ function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_orde } } + $exclusions = apply_filters('list_cats_exclusions', $exclusions); + if (intval($categories)==0){ $sort_column = 'cat_'.$sort_column; diff --git a/wp-includes/version.php b/wp-includes/version.php index 8cf6983b50..a2209bc9ee 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -2,6 +2,6 @@ // This just holds the version number, in a separate file so we can bump it without cluttering the SVN -$wp_version = '1.5.1.3'; +$wp_version = '1.5.2'; ?> diff --git a/xmlrpc.php b/xmlrpc.php index 460721130d..2ae5b5e05a 100644 --- a/xmlrpc.php +++ b/xmlrpc.php @@ -576,7 +576,14 @@ class wp_xmlrpc_server extends IXR_Server { logIO('O', "Posted ! ID: $post_ID"); // FIXME: do we pingback always? pingback($content, $post_ID); - trackback_url_list($content_struct['mt_tb_ping_urls'],$post_ID); + // trackback_url_list($content_struct['mt_tb_ping_urls'],$post_ID); + + if ('publish' == $post_status) { + if ($post_pingback) pingback($content, $post_ID); + do_enclose( $content, $post_ID ); + do_trackbacks($post_ID); + do_action('publish_post', $post_ID); + } return strval($post_ID); } @@ -660,7 +667,14 @@ class wp_xmlrpc_server extends IXR_Server { logIO('O',"(MW) Edited ! ID: $post_ID"); // FIXME: do we pingback always? pingback($content, $post_ID); - trackback_url_list($content_struct['mt_tb_ping_urls'], $post_ID); + // trackback_url_list($content_struct['mt_tb_ping_urls'], $post_ID); + if ('publish' == $post_status) { + if ($post_pingback) pingback($content, $post_ID); + do_enclose( $content, $post_ID ); + do_trackbacks($post_ID); + do_action('publish_post', $post_ID); + } + do_action('edit_post', $post_ID); return true; }