Class: Notification

wp.customize. Notification


new Notification(code, params)

Notification.
Parameters:
Name Type Description
code string The error code.
params object Params.
Properties
Name Type Argument Default Description
message string null The error message.
type string <optional>
error The notification type.
fromServer boolean <optional>
false Whether the notification was server-sent.
setting string <optional>
null The setting ID that the notification is related to.
data * <optional>
null Any additional data.
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