Registers a settings error to be displayed to the user.
Description
Part of the Settings API. Use this to show messages to users about settings validation problems, missing settings or anything else. Settings errors should be added inside the $sanitize_callback function defined in register_setting() for a given setting to give feedback about the submission. By default messages will show immediately after the submission that generated the error.Additional calls to settings_errors() can be used to show errors even when the settings page is first accessed.
Parameters
$settingstring
Slug title of the setting to which this error applies.
$codestring
Slug-name to identify the error. Used as part of 'id' attribute in HTML output.
$messagestring
The formatted message text to display to the user (will be shown inside styled <div> and <p> tags).
$typestringoptional
Message type, controls HTML class. Possible values include 'error', 'success', 'warning', 'info'. Default 'error'.Default: 'error'
Signature, return type and hooks compared across 5 parsed releases.
5.3.0
Added warning and info as possible values for $type.from the docblock
3.0.0
Introduced.from the docblock
About this page
Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-admin/includes/template.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.