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

@ -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'];

View File

@ -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');