[wp-trac] [WordPress Trac] #60281: Cannot unset comment_notes_before
WordPress Trac
noreply at wordpress.org
Thu Jan 18 13:40:04 UTC 2024
#60281: Cannot unset comment_notes_before
--------------------------+------------------------------
Reporter: bugnumber9 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Comments | Version: 6.4.2
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Comment (by bugnumber9):
I also get a notice `Undefined index: comment_notes_before` that barks at
`$comment_notes_before_field = $fields['comment_notes_before'];` in the
first code.
However, it's mentioned in
https://developer.wordpress.org/reference/functions/comment_form/, and I
can access and modify it like this:
{{{
function my_change_comments_fields( $fields ) {
$fields['comment_notes_before'] = '<p>Custom text here.</p>';
return $fields;
}
add_filter( 'comment_form_defaults', 'my_change_comments_fields' );
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/60281#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list