[wp-trac] [WordPress Trac] #56389: Make wp_required_field_indicator and wp_required_field_message filterable

WordPress Trac noreply at wordpress.org
Tue Aug 16 17:14:07 UTC 2022


#56389: Make wp_required_field_indicator and wp_required_field_message filterable
-------------------------------------------------+-------------------------
 Reporter:  kebbet                               |       Owner:  audrasjb
     Type:  enhancement                          |      Status:  reviewing
 Priority:  normal                               |   Milestone:  6.1
Component:  General                              |     Version:  trunk
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-dev-note needs-      |     Focuses:
  unit-tests                                     |
-------------------------------------------------+-------------------------
Changes (by sabernhardt):

 * keywords:  has-patch needs-dev-note => has-patch needs-dev-note needs-
     unit-tests


Comment:

 I need to add a comment on #23870 to check for agreement whether filtering
 the full markup is a better option than filtering only the glyph. And the
 participants on that ticket would need props here, as this would close
 both tickets. (I already took the translated asterisk from that ticket.)

 If we do not filter the glyph on its own, we could combine the two lines,
 as @audrasjb suggested on PR 2982 (I had separated them specifically for
 the other filter):
 {{{
 /* translators: Character to identify required form fields. */
 $indicator = '<span class="required" aria-hidden="true">' . esc_html__(
 '*' ) . '</span>';
 }}}

 Also, the `wp_required_field_indicator` description could be improved,
 perhaps like this:
 "Filters the markup for ''a'' visual indicator ''of'' required form
 fields."

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


More information about the wp-trac mailing list