[wp-trac] [WordPress Trac] #16576: comment_form() fields being displayed only for non logged in users
WordPress Trac
noreply at wordpress.org
Tue Jul 29 16:12:33 UTC 2025
#16576: comment_form() fields being displayed only for non logged in users
---------------------------------------------------+---------------------
Reporter: maorb | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: Comments | Version: 3.0.5
Severity: normal | Resolution:
Keywords: has-patch needs-testing bulk-reopened | Focuses:
---------------------------------------------------+---------------------
Comment (by iamadisingh):
== Test Report
=== Description
This report validates whether the indicated patch works as expected.
Patch tested: https://github.com/WordPress/wordpress-develop/pull/9343
=== Environment
- WordPress: 6.9-alpha-60093-src
- PHP: 8.2.28
- Server: nginx/1.27.3
- Database: mysqli (Server: 8.4.5 / Client: mysqlnd 8.2.28)
- Browser: Chrome 138.0.0.0
- OS: macOS
- Theme: Twenty Twenty-Five 1.3
- MU Plugins: None activated
- Plugins:
* Test Reports 1.2.0
=== Actual Results
1. ✅ Issue resolved with patch.
=== Additional Notes
- Using `comment_form_default_fields` filter to add a "Location" field to
the comment form:
{{{#!php
<?php
add_filter( 'comment_form_default_fields', function( $fields ) {
$fields['Location'] = '<p class="comment-form-location">' .
'<label for="location">' . __( 'Location' ) . '</label>' .
'<input id="location" name="location" type="text" value=""
size="30" /></p>';
return $fields;
});
}}}
- Tested as Non-Logged-In User: The "Location" field appeared in the
comment form as expected.
- Tested as Logged-In User: The "Location" field also appeared for logged-
in users.
=== Supplemental Artifacts
For Loged In Users: https://ibb.co/ZpzfFSPc
For Loged Out Users: https://ibb.co/vCHhPpfQ
--
Ticket URL: <https://core.trac.wordpress.org/ticket/16576#comment:19>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list