[wp-trac] [WordPress Trac] #23870: Filter Glyph for Comment Required Fields

WordPress Trac noreply at wordpress.org
Sun Oct 9 18:15:34 UTC 2016


#23870: Filter Glyph for Comment Required Fields
--------------------------------------+-----------------------------
 Reporter:  cais                      |       Owner:
     Type:  enhancement               |      Status:  new
 Priority:  normal                    |   Milestone:  Future Release
Component:  I18N                      |     Version:  3.5
 Severity:  normal                    |  Resolution:
 Keywords:  good-first-bug has-patch  |     Focuses:  template
--------------------------------------+-----------------------------
Changes (by SergeyBiryukov):

 * keywords:  needs-patch good-first-bug => good-first-bug has-patch


Comment:

 * Are we sure it should be a filter rather than a `comment_form()`
 argument?
 * The filter name should start with `comment_form` rather than
 `comment_fields`, for consistency with other `comment_form()` filters.
 * The new filter needs to be documented as per the
 [https://make.wordpress.org/core/handbook/best-practices/inline-
 documentation-standards/php/ WordPress PHP documentation standards].
 * I agree the default string can be translatable, I don't see a reason to
 alter other strings here though.

 Replying to [comment:15 cais]:
 > I also added a couple more conditional checks to insure required related
 items are only used if actually required. For example, if (for whatever
 reason) the `get_option( 'require_name_email' )` is false then there is no
 reason to have any value for `$required_text`.

 This makes the check below redundant: `( $req ? $required_text : '' )`,
 but I agree it's better to consolidate these checks in one place.
 `$required_text` should also be an empty string if `$req` is set, but
 `$req_mark` is empty.

 Any objections to [attachment:23870.5.patch]?

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


More information about the wp-trac mailing list