Remove existing error messages before adding the latest response

This commit is contained in:
Kelly Dwan 2019-12-11 16:08:36 -05:00
parent 5f705e80f6
commit e513a20d07
No known key found for this signature in database
GPG key ID: 8BA5575F3D11575D

View file

@ -99,6 +99,7 @@ jQuery( document ).ready( function( $ ) {
closeModal();
$( button ).after( $( '<p>' ).html( '<em>' + response.message + '<em>' ) );
} else {
$( 'div.notice' ).remove();
const $message = $( '<div>' )
.addClass( 'notice notice-alt' )
.addClass( response.success ? 'notice-success' : 'notice-error' )