On this page
wp_required_field_message(): string
Creates a message to explain required form fields.
Return
string Message text and glyph wrapped in a span tag.
Source
File: wp-includes/general-template.php. View all references
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.
Related
Uses
| Uses | Description |
|---|---|
| wp_required_field_indicator() wp-includes/general-template.php | Assigns a visual indicator for required form fields. |
| __() wp-includes/l10n.php | Retrieves the translation of $text. |
| apply_filters() wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
Used By
| Used By | Description |
|---|---|
| wp_media_insert_url_form() wp-admin/includes/media.php | Creates the form for external url. |
| get_media_item() wp-admin/includes/media.php | Retrieves HTML form for modifying the image attachment. |
| get_compat_media_markup() wp-admin/includes/media.php | |
| comment_form() wp-includes/comment-template.php | Outputs a complete commenting form for use within a template. |
Changelog
| Version | Description |
|---|---|
| 6.1.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_required_field_message