[wp-trac] [WordPress Trac] #54394: Add functions for required fields indicator and message
WordPress Trac
noreply at wordpress.org
Thu Jun 30 14:12:32 UTC 2022
#54394: Add functions for required fields indicator and message
-------------------------------------------------+-------------------------
Reporter: sabernhardt | Owner: audrasjb
Type: feature request | Status: reviewing
Priority: normal | Milestone: 6.1
Component: General | Version:
Severity: normal | Resolution:
Keywords: has-patch required-fields dev- | Focuses:
feedback | accessibility
-------------------------------------------------+-------------------------
Comment (by sabernhardt):
The current PR contains the [https://github.com/WordPress/wordpress-
develop/pull/2821/files#diff-
5526e2d644a04f0c466d6c749542fdb7952021784e7b1583ff45f9d12601ef52R8472-R8473
translatable string] proposed in #23870. That still might be filterable,
yet these functions would not work well with the argument concept
suggested there. Perhaps switching to an `$args` array in these functions
would be more flexible.
{{{
function wp_required_field_indicator( $args = array() ) {
$defaults = array(
'space_before' => ' ',
/* translators: Character to identify required form
fields. */
'glyph' => __( '*' ),
'display' => false,
);
$args = wp_parse_args( $args, $defaults );
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/54394#comment:31>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list