new Notification(code, params)
Notification.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
code |
string | The error code. | ||||||||||||||||||||||||||||||
params |
object | Params.
Properties
|
- Since:
-
- 4.6.0
- Source:
Extends
- wp.customize.Class
Members
-
containerClasses :string
-
Additional class names to add to the notification container.
Type:
- string
- Since:
-
- 4.9.0
- Source:
-
template :function
-
Template function for rendering the notification. This will be populated with template option or else it will be populated with template from the ID.
Type:
- function
- Since:
-
- 4.9.0
- Source:
-
templateId :string
-
ID for the template to render the notification.
Type:
- string
- Since:
-
- 4.9.0
- Source:
Methods
-
initialize(code, params)
-
Initialize notification.
Parameters:
Name Type Description code
string Notification code. params
object Notification parameters. Properties
Name Type Argument Default Description message
string Message. type
string <optional>
error Type. setting
string <optional>
Related setting ID. template
function <optional>
Function for rendering template. If not provided, this will come from templateId. templateId
string <optional>
ID for template to render the notification. containerClasses
string <optional>
Additional class names to add to the notification container. dismissible
boolean <optional>
Whether the notification can be dismissed. - Since:
-
- 4.9.0
- Source:
-
render()
-
Render the notification.
- Since:
-
- 4.9.0
- Source:
Returns:
Notification container element.- Type
- jQuery