Skip to content

Commit 16aedab

Browse files
committed
Update
1 parent dc97cd0 commit 16aedab

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

.dev/assets/admin/js/common-action-modal/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ const DeactivateModal = ( { apiUrl, getParams, isEvent, pageData } ) => {
9191
<div className="go-deactivate-modal__checkbox">
9292
{ goThemeDeactivateData.choices.map( ( choice ) => {
9393
const isChecked = formData.choices.indexOf( choice.slug ) >= 0;
94+
if ( typeof choice !== 'object' ) {
95+
return;
96+
}
9497
return (
9598
<div key={ choice.slug }>
9699
<CheckboxControl

includes/classes/admin/class-go-theme-deactivation.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,17 @@ public function enqueue_scripts( $hook_suffix ) {
8888
'is_checked' => false,
8989
'text_field' => null,
9090
],
91-
[
92-
'slug' => 'other',
93-
'label' => 'Other reason:',
94-
'is_checked' => false,
95-
'text_field' => 'choice_other_text',
96-
]
91+
];
92+
93+
// Randomize the choices.
94+
shuffle( $deactivation_form_choices );
95+
96+
// Ensure "Other Reason" is last.
97+
$deactivation_form_choices[] = [
98+
'slug' => 'other',
99+
'label' => 'Other reason:',
100+
'is_checked' => false,
101+
'text_field' => 'choice_other_text',
97102
];
98103

99104
$deactivation_labels = [

0 commit comments

Comments
 (0)