You should be able to change the defaults

git-svn-id: http://svn.automattic.com/wordpress/trunk@2753 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
matt 2005-08-05 20:44:18 +00:00
parent cbbe477c85
commit fd1748ef2f
2 changed files with 22 additions and 10 deletions

View File

@ -93,6 +93,12 @@ function edit_post() {
if ( 'publish' == $_POST['post_status'] && ! current_user_can('publish_posts') ) if ( 'publish' == $_POST['post_status'] && ! current_user_can('publish_posts') )
$_POST['post_status'] = 'draft'; $_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']) ) { if ( !empty($_POST['edit_date']) ) {
$aa = $_POST['aa']; $aa = $_POST['aa'];
$mm = $_POST['mm']; $mm = $_POST['mm'];

View File

@ -26,6 +26,8 @@ function wp_insert_post($postarr = array()) {
$post_category = apply_filters('category_save_pre', $post_category); $post_category = apply_filters('category_save_pre', $post_category);
$post_status = apply_filters('status_save_pre', $post_status); $post_status = apply_filters('status_save_pre', $post_status);
$post_name = apply_filters('name_save_pre', $post_name); $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 // Make sure we set a valid category
if (0 == count($post_category) || !is_array($post_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)) if (empty($post_date_gmt))
$post_date_gmt = current_time('mysql', 1); $post_date_gmt = current_time('mysql', 1);
if (empty($comment_status)) if ( empty($comment_status) ) {
if ( $update )
$comment_status = 'closed';
else
$comment_status = get_settings('default_comment_status'); $comment_status = get_settings('default_comment_status');
if (empty($ping_status)) }
if ( empty($ping_status) )
$ping_status = get_settings('default_ping_status'); $ping_status = get_settings('default_ping_status');
if ( empty($post_pingback) ) if ( empty($post_pingback) )
$post_pingback = get_option('default_pingback_flag'); $post_pingback = get_option('default_pingback_flag');