wp_required_field_message(): string

In this article

Creates a message to explain required form fields.

Return

string Message text and glyph wrapped in a span tag.

Source

function wp_required_field_message() {
	$message = sprintf(
		'<span class="required-field-message">%s</span>',
		/* translators: %s: Asterisk symbol (*). */
		sprintf( __( 'Required fields are marked %s' ), wp_required_field_indicator() )
	);

	/**
	 * Filters the message to explain required form fields.
	 *
	 * @since 6.1.0
	 *
	 * @param string $message Message text and glyph wrapped in a `span` tag.
	 */
	return apply_filters( 'wp_required_field_message', $message );
}

Hooks

apply_filters( ‘wp_required_field_message’, string $message )

Filters the message to explain required form fields.

Changelog

VersionDescription
6.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.