Make WordPress Core

Ticket #13473: 13473.diff

File 13473.diff, 921 bytes (added by solarissmoke, 13 years ago)

Check whether post type supports comments/pings before setting it to default

  • wp-admin/includes/post.php

     
    9696                $post_data['post_status'] = $previous_status;
    9797
    9898        if (!isset( $post_data['comment_status'] ))
    99                 $post_data['comment_status'] = 'closed';
     99                $post_data['comment_status'] =  post_type_supports( $post_data['post_type'], 'comments' ) ? get_option( 'default_comment_status' ) : 'closed';
    100100
    101101        if (!isset( $post_data['ping_status'] ))
    102                 $post_data['ping_status'] = 'closed';
     102                $post_data['ping_status'] =  post_type_supports( $post_data['post_type'], 'trackbacks' ) ? get_option( 'default_ping_status' ) : 'closed';
    103103
    104104        foreach ( array('aa', 'mm', 'jj', 'hh', 'mn') as $timeunit ) {
    105105                if ( !empty( $post_data['hidden_' . $timeunit] ) && $post_data['hidden_' . $timeunit] != $post_data[$timeunit] ) {