[wp-trac] [WordPress Trac] #60281: Cannot unset comment_notes_before

WordPress Trac noreply at wordpress.org
Thu Jan 18 16:33:01 UTC 2024


#60281: Cannot unset comment_notes_before
------------------------------+-----------------------------
 Reporter:  bugnumber9        |       Owner:  (none)
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:  Future Release
Component:  Comments          |     Version:  3.0
 Severity:  normal            |  Resolution:
 Keywords:  needs-unit-tests  |     Focuses:
------------------------------+-----------------------------

Comment (by shooper):

 Tested this on TwentyTwentyFour with WP 6.4.2.

 I think the problem here was the wrong filter being used. The
 `comment_notes_before` is not a comment form field, but part of the
 comment form defaults.

 Using the `comment_form_defaults` filter will unset that value:

 {{{#!php
 function my_update_comment_defaults( $defaults ) {
     $defaults['comment_notes_before'] = '';
     return $defaults;
 }
 add_filter( 'comment_form_defaults', 'my_update_comment_defaults' );

 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60281#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list