diff --git src/wp-admin/includes/post.php src/wp-admin/includes/post.php
index 1be4868..2ab5335 100644
|
|
function get_default_post_to_edit( $post_type = 'post', $create_in_db = false ) |
610 | 610 | $post->post_status = 'draft'; |
611 | 611 | $post->to_ping = ''; |
612 | 612 | $post->pinged = ''; |
613 | | $post->comment_status = get_option( 'default_comment_status' ); |
614 | | $post->ping_status = get_option( 'default_ping_status' ); |
| 613 | $post->comment_status = get_default_comment_status( $post_type ); |
| 614 | $post->ping_status = get_default_comment_status( $post_type, 'pingback' ); |
615 | 615 | $post->post_pingback = get_option( 'default_pingback_flag' ); |
616 | 616 | $post->post_category = get_option( 'default_category' ); |
617 | 617 | $post->page_template = 'default'; |
diff --git src/wp-admin/post.php src/wp-admin/post.php
index 65140aa..9ff7f31 100644
|
|
case 'post-quickdraft-save': |
129 | 129 | $post = get_post( $_REQUEST['post_ID'] ); |
130 | 130 | check_admin_referer( 'add-' . $post->post_type ); |
131 | 131 | |
132 | | $_POST['comment_status'] = get_option( 'default_comment_status' ); |
133 | | $_POST['ping_status'] = get_option( 'default_ping_status' ); |
| 132 | $_POST['comment_status'] = get_default_comment_status( $post->post_type ); |
| 133 | $_POST['ping_status'] = get_default_comment_status( $post->post_type, 'pingback' ); |
134 | 134 | |
135 | 135 | edit_post(); |
136 | 136 | wp_dashboard_quick_press(); |
diff --git src/wp-includes/class-wp-xmlrpc-server.php src/wp-includes/class-wp-xmlrpc-server.php
index 4a68aaa..0573b71 100644
|
|
class wp_xmlrpc_server extends IXR_Server { |
4809 | 4809 | $comment_status = 'open'; |
4810 | 4810 | break; |
4811 | 4811 | default: |
4812 | | $comment_status = get_option('default_comment_status'); |
| 4812 | $comment_status = get_default_comment_status( $post_type ); |
4813 | 4813 | break; |
4814 | 4814 | } |
4815 | 4815 | } else { |
… |
… |
class wp_xmlrpc_server extends IXR_Server { |
4822 | 4822 | $comment_status = 'open'; |
4823 | 4823 | break; |
4824 | 4824 | default: |
4825 | | $comment_status = get_option('default_comment_status'); |
| 4825 | $comment_status = get_default_comment_status( $post_type ); |
4826 | 4826 | break; |
4827 | 4827 | } |
4828 | 4828 | } |
4829 | 4829 | } else { |
4830 | | $comment_status = get_option('default_comment_status'); |
| 4830 | $comment_status = get_default_comment_status( $post_type ); |
4831 | 4831 | } |
4832 | 4832 | |
4833 | 4833 | if ( isset($content_struct['mt_allow_pings']) ) { |
… |
… |
class wp_xmlrpc_server extends IXR_Server { |
4840 | 4840 | $ping_status = 'open'; |
4841 | 4841 | break; |
4842 | 4842 | default: |
4843 | | $ping_status = get_option('default_ping_status'); |
| 4843 | $ping_status = get_default_comment_status( $post_type, 'pingback' ); |
4844 | 4844 | break; |
4845 | 4845 | } |
4846 | 4846 | } else { |
… |
… |
class wp_xmlrpc_server extends IXR_Server { |
4852 | 4852 | $ping_status = 'open'; |
4853 | 4853 | break; |
4854 | 4854 | default: |
4855 | | $ping_status = get_option('default_ping_status'); |
| 4855 | $ping_status = get_default_comment_status( $post_type, 'pingback' ); |
4856 | 4856 | break; |
4857 | 4857 | } |
4858 | 4858 | } |
4859 | 4859 | } else { |
4860 | | $ping_status = get_option('default_ping_status'); |
| 4860 | $ping_status = get_default_comment_status( $post_type, 'pingback' ); |
4861 | 4861 | } |
4862 | 4862 | |
4863 | 4863 | if ( $post_more ) |
… |
… |
class wp_xmlrpc_server extends IXR_Server { |
5120 | 5120 | $comment_status = 'open'; |
5121 | 5121 | break; |
5122 | 5122 | default: |
5123 | | $comment_status = get_option('default_comment_status'); |
| 5123 | $comment_status = get_default_comment_status( $post_type ); |
5124 | 5124 | break; |
5125 | 5125 | } |
5126 | 5126 | } else { |
… |
… |
class wp_xmlrpc_server extends IXR_Server { |
5133 | 5133 | $comment_status = 'open'; |
5134 | 5134 | break; |
5135 | 5135 | default: |
5136 | | $comment_status = get_option('default_comment_status'); |
| 5136 | $comment_status = get_default_comment_status( $post_type ); |
5137 | 5137 | break; |
5138 | 5138 | } |
5139 | 5139 | } |
… |
… |
class wp_xmlrpc_server extends IXR_Server { |
5149 | 5149 | $ping_status = 'open'; |
5150 | 5150 | break; |
5151 | 5151 | default: |
5152 | | $ping_status = get_option('default_ping_status'); |
| 5152 | $ping_status = get_default_comment_status( $post_type, 'pingback' ); |
5153 | 5153 | break; |
5154 | 5154 | } |
5155 | 5155 | } else { |
… |
… |
class wp_xmlrpc_server extends IXR_Server { |
5161 | 5161 | $ping_status = 'open'; |
5162 | 5162 | break; |
5163 | 5163 | default: |
5164 | | $ping_status = get_option('default_ping_status'); |
| 5164 | $ping_status = get_default_comment_status( $post_type, 'pingback' ); |
5165 | 5165 | break; |
5166 | 5166 | } |
5167 | 5167 | } |
diff --git src/wp-includes/post.php src/wp-includes/post.php
index 52600b8..3921ec6 100644
|
|
function get_default_comment_status( $post_type = 'post', $comment_type = 'comme |
4111 | 4111 | * |
4112 | 4112 | * @param string $status Default status for the given post type, |
4113 | 4113 | * either 'open' or 'closed'. |
4114 | | * @param string $comment_type Type of comment. Default is `comment`. |
| 4114 | * @param string $post_type Post type. Default is `post`. |
| 4115 | * @param string $comment_type Comment type. Default is `comment`. |
4115 | 4116 | */ |
4116 | | return apply_filters( "get_{$post_type}_default_comment_status", $status, $comment_type ); |
| 4117 | return apply_filters( 'get_default_comment_status' , $status, $post_type, $comment_type ); |
4117 | 4118 | } |
4118 | 4119 | |
4119 | 4120 | /** |