Core Function
View Source on Trac ↗ add_settings_error()
add_settings_error( mixed $setting, mixed $code, mixed $message, mixed $type = 'error' ) Registers a settings error to be displayed to the user.
Parameters 4 required
| Name / Type | Description |
|---|---|
| $setting string | Slug title of the setting to which this error applies. Required |
| $code string | Slug-name to identify the error. Used as part of 'id' attribute in HTML output. Required |
| string | $message The formatted message text to display to the user (will be shown inside styled `<div>` and `<p>` tags). Required |
| string | $type Optional. Message type, controls HTML class. Possible values include 'error', 'success', 'warning', 'info'. Default 'error'. Required |
Return Value
(void)
No return value description available.
Function Information
Since Version
3.0.0
Source File
wp-admin/includes/template.php
Advertisement