From fd1748ef2f556fafe93b21c23920490eff53ffb0 Mon Sep 17 00:00:00 2001 From: matt Date: Fri, 5 Aug 2005 20:44:18 +0000 Subject: [PATCH] You should be able to change the defaults git-svn-id: http://svn.automattic.com/wordpress/trunk@2753 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin-functions.php | 8 +++++++- wp-includes/functions-post.php | 24 +++++++++++++++--------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index 0f7ed846bf..b7c3b18e6d 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -92,7 +92,13 @@ function edit_post() { if ( 'publish' == $_POST['post_status'] && ! current_user_can('publish_posts') ) $_POST['post_status'] = 'draft'; - + + if ( !isset($_POST['comment_status']) ) + $_POST['comment_status'] = 'closed'; + + if ( !isset($_POST['ping_status']) ) + $_POST['ping_status'] = 'closed'; + if ( !empty($_POST['edit_date']) ) { $aa = $_POST['aa']; $mm = $_POST['mm']; diff --git a/wp-includes/functions-post.php b/wp-includes/functions-post.php index 7339a26804..87c9e1a9ab 100644 --- a/wp-includes/functions-post.php +++ b/wp-includes/functions-post.php @@ -20,12 +20,14 @@ function wp_insert_post($postarr = array()) { } // Get the basics. - $post_content = apply_filters('content_save_pre', $post_content); - $post_excerpt = apply_filters('excerpt_save_pre', $post_excerpt); - $post_title = apply_filters('title_save_pre', $post_title); - $post_category = apply_filters('category_save_pre', $post_category); - $post_status = apply_filters('status_save_pre', $post_status); - $post_name = apply_filters('name_save_pre', $post_name); + $post_content = apply_filters('content_save_pre', $post_content); + $post_excerpt = apply_filters('excerpt_save_pre', $post_excerpt); + $post_title = apply_filters('title_save_pre', $post_title); + $post_category = apply_filters('category_save_pre', $post_category); + $post_status = apply_filters('status_save_pre', $post_status); + $post_name = apply_filters('name_save_pre', $post_name); + $comment_status = apply_filters('comment_status_pre', $comment_status); + $ping_status = apply_filters('ping_status_pre', $ping_status); // Make sure we set a valid category if (0 == count($post_category) || !is_array($post_category)) { @@ -61,9 +63,13 @@ function wp_insert_post($postarr = array()) { if (empty($post_date_gmt)) $post_date_gmt = current_time('mysql', 1); - if (empty($comment_status)) - $comment_status = get_settings('default_comment_status'); - if (empty($ping_status)) + if ( empty($comment_status) ) { + if ( $update ) + $comment_status = 'closed'; + else + $comment_status = get_settings('default_comment_status'); + } + if ( empty($ping_status) ) $ping_status = get_settings('default_ping_status'); if ( empty($post_pingback) ) $post_pingback = get_option('default_pingback_flag');