Make WordPress Core

Ticket #44373: 44373.patch

File 44373.patch, 5.3 KB (added by azaozz, 7 years ago)
  • src/wp-admin/includes/schema.php

     
    535535
    536536                // 4.9.6
    537537                'wp_page_for_privacy_policy'      => 0,
     538               
     539                // 4.9.7
     540                'show_comments_cookies_opt_in'    => 0,
    538541        );
    539542
    540543        // 3.3
  • src/wp-admin/options-discussion.php

     
    8585?>
    8686</label>
    8787<br />
     88
     89<label for="show_comments_cookies_opt_in">
     90<input name="show_comments_cookies_opt_in" type="checkbox" id="show_comments_cookies_opt_in" value="1" <?php checked( '1', get_option( 'show_comments_cookies_opt_in' ) ); ?> />
     91<?php _e( 'Show comments cookies opt-in checkbox.' ); ?>
     92</label>
     93<br />
     94
    8895<label for="thread_comments">
    8996<input name="thread_comments" type="checkbox" id="thread_comments" value="1" <?php checked( '1', get_option( 'thread_comments' ) ); ?> />
    9097<?php
  • src/wp-admin/options.php

     
    8080        );
    8181}
    8282
    83 $whitelist_options         = array(
    84         'general'    => array( 'blogname', 'blogdescription', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'timezone_string', 'WPLANG', 'new_admin_email' ),
    85         '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' ),
    86         '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' ),
    87         'reading'    => array( 'posts_per_page', 'posts_per_rss', 'rss_use_excerpt', 'show_on_front', 'page_on_front', 'page_for_posts', 'blog_public' ),
    88         'writing'    => array( 'default_category', 'default_email_category', 'default_link_category', 'default_post_format' ),
     83$whitelist_options = array(
     84        'general'    => array(
     85                                                'blogname',
     86                                                'blogdescription',
     87                                                'gmt_offset',
     88                                                'date_format',
     89                                                'time_format',
     90                                                'start_of_week',
     91                                                'timezone_string',
     92                                                'WPLANG',
     93                                                'new_admin_email',
     94                                        ),
     95        'discussion' => array(
     96                                                'default_pingback_flag',
     97                                                'default_ping_status',
     98                                                'default_comment_status',
     99                                                'comments_notify',
     100                                                'moderation_notify',
     101                                                'comment_moderation',
     102                                                'require_name_email',
     103                                                'comment_whitelist',
     104                                                'comment_max_links',
     105                                                'moderation_keys',
     106                                                'blacklist_keys',
     107                                                'show_avatars',
     108                                                'avatar_rating',
     109                                                'avatar_default',
     110                                                'close_comments_for_old_posts',
     111                                                'close_comments_days_old',
     112                                                'thread_comments',
     113                                                'thread_comments_depth',
     114                                                'page_comments',
     115                                                'comments_per_page',
     116                                                'default_comments_page',
     117                                                'comment_order',
     118                                                'comment_registration',
     119                                                'show_comments_cookies_opt_in',
     120                                        ),
     121        'media'      => array(
     122                                                'thumbnail_size_w',
     123                                                'thumbnail_size_h',
     124                                                'thumbnail_crop',
     125                                                'medium_size_w',
     126                                                'medium_size_h',
     127                                                'large_size_w',
     128                                                'large_size_h',
     129                                                'image_default_size',
     130                                                'image_default_align',
     131                                                'image_default_link_type',
     132                                        ),
     133        'reading'    => array(
     134                                                'posts_per_page',
     135                                                'posts_per_rss',
     136                                                'rss_use_excerpt',
     137                                                'show_on_front',
     138                                                'page_on_front',
     139                                                'page_for_posts',
     140                                                'blog_public',
     141                                        ),
     142        'writing'    => array(
     143                                                'default_category',
     144                                                'default_email_category',
     145                                                'default_link_category',
     146                                                'default_post_format',
     147                                        ),
    89148);
    90149$whitelist_options['misc'] = $whitelist_options['options'] = $whitelist_options['privacy'] = array();
    91150
  • src/wp-includes/comment-template.php

     
    22712271                                         '<input id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" maxlength="200" /></p>',
    22722272        );
    22732273
    2274         if ( has_action( 'set_comment_cookies', 'wp_set_comment_cookies' ) ) {
     2274        if ( has_action( 'set_comment_cookies', 'wp_set_comment_cookies' ) && get_option( 'show_comments_cookies_opt_in' ) ) {
    22752275                $consent           = empty( $commenter['comment_author_email'] ) ? '' : ' checked="checked"';
    22762276                $fields['cookies'] = '<p class="comment-form-cookies-consent"><input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes"' . $consent . ' />' .
    22772277                                                         '<label for="wp-comment-cookies-consent">' . __( 'Save my name, email, and website in this browser for the next time I comment.' ) . '</label></p>';