- Timestamp:
- 07/20/2018 12:37:40 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment-template.php
r43469 r43518 2276 2276 $fields['cookies'] = '<p class="comment-form-cookies-consent"><input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes"' . $consent . ' />' . 2277 2277 '<label for="wp-comment-cookies-consent">' . __( 'Save my name, email, and website in this browser for the next time I comment.' ) . '</label></p>'; 2278 2279 // Ensure that the passed fields include cookies consent. 2280 if ( isset( $args['fields'] ) && ! isset( $args['fields']['cookies'] ) ) { 2281 $args['fields']['cookies'] = $fields['cookies']; 2282 } 2278 2283 } 2279 2284 -
trunk/tests/phpunit/tests/comment/commentForm.php
r42343 r43518 81 81 return $defaults; 82 82 } 83 84 /** 85 * @ticket 44126 86 */ 87 public function test_fields_should_include_cookies_consent() { 88 $p = self::factory()->post->create(); 89 90 add_filter( 'option_show_comments_cookies_opt_in', '__return_true' ); 91 92 $args = array( 93 'fields' => array( 94 'author' => 'Hello World!', 95 ), 96 ); 97 $form = get_echo( 'comment_form', array( $args, $p ) ); 98 99 remove_filter( 'option_show_comments_cookies_opt_in', '__return_true' ); 100 101 $this->assertRegExp( '|<p class="comment\-form\-cookies\-consent">.*?</p>|', $form ); 102 } 83 103 }
Note: See TracChangeset
for help on using the changeset viewer.