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:
parent
cbbe477c85
commit
fd1748ef2f
|
@ -93,6 +93,12 @@ 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'];
|
||||
|
|
|
@ -26,6 +26,8 @@ function wp_insert_post($postarr = array()) {
|
|||
$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))
|
||||
if ( empty($comment_status) ) {
|
||||
if ( $update )
|
||||
$comment_status = 'closed';
|
||||
else
|
||||
$comment_status = get_settings('default_comment_status');
|
||||
if (empty($ping_status))
|
||||
}
|
||||
if ( empty($ping_status) )
|
||||
$ping_status = get_settings('default_ping_status');
|
||||
if ( empty($post_pingback) )
|
||||
$post_pingback = get_option('default_pingback_flag');
|
||||
|
|
Loading…
Reference in New Issue