Displays settings errors registered by add_settings_error().
Description
Part of the Settings API. Outputs a div for each error retrieved by get_settings_errors(). This is called automatically after a settings page based on the Settings API is submitted. Errors should be added during the validation callback function for a setting defined in register_setting(). The $sanitize option is passed into get_settings_errors() and will re-run the setting sanitization on its current value. The $hide_on_update option will cause errors to only show when the settings page is first loaded. if the user has already saved new values it will be hidden to avoid repeating messages already shown in the default error reporting after submission. This is useful to show general errors like missing settings when the user arrives at the settings page.
Parameters
$settingstringoptional
Optional slug title of a specific setting whose errors you want.Default: ''
$sanitizebooloptional
Whether to re-sanitize the setting value before returning errors.Default: false
$hide_on_updatebooloptional
If set to true errors will not be shown if the settings page has already been submitted.Default: false
Signature, return type and hooks compared across 5 parsed releases.
5.3.0
Legacy error and updated CSS classes are mapped to notice-error and notice-success.from the docblock
3.0.0
Introduced.from the docblock
About this page
Parsed data
Generated from the wordpress-develop 6.8.8 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.