wp_required_field_indicator() – Assigns a visual indicator for required form fields.

You appear to be a bot. Output may be restricted

Description

Assigns a visual indicator for required form fields.

Usage

$string = wp_required_field_indicator();

Parameters

Returns

string Indicator glyph wrapped in a span tag.

Source

File name: wordpress/wp-includes/general-template.php
Lines:

1 to 14 of 14
function wp_required_field_indicator() {
  /* translators: Character to identify required form fields. */
  $glyph     = __( '*' );
  $indicator = '<span class="required">' . esc_html( $glyph ) . '</span>';

  
/**
 * Filters the markup for a visual indicator of required form fields.
 *
 * @since 6.1.0
 *
 * @param string $indicator Markup for the indicator element.
 */
  return apply_filters( 'wp_required_field_indicator', $indicator );
}
 

 View on GitHub View on Trac