WordPress.org

Make WordPress Core

Changeset 14448


Ignore:
Timestamp:
05/04/10 19:31:24 (5 years ago)
Author:
wpmuguru
Message:

add default comment status setting for pages, props messenlehner, see #12991

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/post.php

    r14446 r14448  
    380380        $post->to_ping = ''; 
    381381        $post->pinged = ''; 
    382         $post->comment_status = get_option( 'default_comment_status' ); 
     382        if ( 'page' == $post_type ) { 
     383            $post->comment_status = get_option( 'default_comment_status_page' ); 
     384        } else { 
     385            $post->comment_status = get_option( 'default_comment_status' ); 
     386        } 
    383387        $post->ping_status = get_option( 'default_ping_status' ); 
    384388        $post->post_pingback = get_option( 'default_pingback_flag' ); 
  • trunk/wp-admin/options-discussion.php

    r14139 r14448  
    4343<br /> 
    4444<small><em><?php echo '(' . __('These settings may be overridden for individual articles.') . ')'; ?></em></small> 
     45<br /> 
     46<label for="default_comment_status_page"> 
     47<input name="default_comment_status_page" type="checkbox" id="default_comment_status_page" value="open" <?php checked('open', get_option('default_comment_status_page')); ?> /> 
     48<?php _e('Allow people to post comments on new pages') ?></label> 
     49<br /> 
     50<small><em><?php echo '(' . __('These settings may be overridden for individual pages.') . ')'; ?></em></small> 
    4551</fieldset></td> 
    4652</tr> 
  • trunk/wp-admin/options.php

    r14316 r14448  
    5757$whitelist_options = array( 
    5858    'general' => array( 'blogname', 'blogdescription', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'timezone_string' ), 
    59     'discussion' => array( 'default_pingback_flag', 'default_ping_status', 'default_comment_status', 'comments_notify', 'moderation_notify', 'comment_moderation', 'require_name_email', 'comment_whitelist', 'comment_max_links', 'moderation_keys', 'blacklist_keys', 'show_avatars', 'avatar_rating', 'avatar_default', 'close_comments_for_old_posts', 'close_comments_days_old', 'thread_comments', 'thread_comments_depth', 'page_comments', 'comments_per_page', 'default_comments_page', 'comment_order', 'comment_registration' ), 
     59    'discussion' => array( 'default_pingback_flag', 'default_ping_status', 'default_comment_status_page', 'default_comment_status', 'comments_notify', 'moderation_notify', 'comment_moderation', 'require_name_email', 'comment_whitelist', 'comment_max_links', 'moderation_keys', 'blacklist_keys', 'show_avatars', 'avatar_rating', 'avatar_default', 'close_comments_for_old_posts', 'close_comments_days_old', 'thread_comments', 'thread_comments_depth', 'page_comments', 'comments_per_page', 'default_comments_page', 'comment_order', 'comment_registration' ), 
    6060    'media' => array( 'thumbnail_size_w', 'thumbnail_size_h', 'thumbnail_crop', 'medium_size_w', 'medium_size_h', 'large_size_w', 'large_size_h', 'image_default_size', 'image_default_align', 'image_default_link_type', 'embed_autourls', 'embed_size_w', 'embed_size_h' ), 
    6161    'privacy' => array( 'blog_public' ), 
  • trunk/wp-includes/post.php

    r14447 r14448  
    21602160            $comment_status = 'closed'; 
    21612161        else 
    2162             $comment_status = get_option('default_comment_status'); 
     2162            if ( 'page' == $post_type ) { 
     2163                $comment_status = get_option( 'default_comment_status_page' ); 
     2164            } else { 
     2165                $comment_status = get_option( 'default_comment_status' ); 
     2166            } 
    21632167    } 
    21642168    if ( empty($ping_status) ) 
Note: See TracChangeset for help on using the changeset viewer.