diff --git a/assets/js/translation-events.js b/assets/js/translation-events.js index b79738bb..69eff146 100644 --- a/assets/js/translation-events.js +++ b/assets/js/translation-events.js @@ -21,12 +21,15 @@ } ); - $( '.trash-event-from-list' ).on( + $( '.trash-event-from-list, #delete-permanently' ).on( 'click', function ( e ) { e.preventDefault(); - if ( confirm( 'Are you sure you want to delete this event?' ) ) { - window.location = $(this).attr('href'); + const permanent_delete_clause = 'delete-permanently' == $(this).attr('id') ? 'permanently' : ''; + const confirmMessage = `Are you sure you want to ${permanent_delete_clause} delete this event?`; + + if ( confirm( confirmMessage ) ) { + window.location = this.href; } } ); diff --git a/themes/wporg-translate-events-2024/blocks/event-delete-link/index.php b/themes/wporg-translate-events-2024/blocks/event-delete-link/index.php index c5e8adbc..e4047023 100644 --- a/themes/wporg-translate-events-2024/blocks/event-delete-link/index.php +++ b/themes/wporg-translate-events-2024/blocks/event-delete-link/index.php @@ -24,6 +24,7 @@ ?>