Skip to content

Commit 4e36131

Browse files
committed
Allow data-wp-action and data-wp-nonce through wp_kses in Settings Form
get_allowed_html() was missing data-wp-action and data-wp-nonce for input and select elements. wp_kses stripped these attributes, so TomSelect could not read the action/nonce off the element and sent AJAX requests without them.
1 parent d92498b commit 4e36131

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

includes/admin/settings/class-settings-form.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ protected function get_allowed_html(): array {
216216
'autocomplete' => true,
217217
// Tom Select data attributes (built-in Settings API feature).
218218
'data-wp-prefix' => true,
219+
'data-wp-action' => true,
220+
'data-wp-nonce' => true,
219221
'data-wp-endpoint' => true,
220222
'data-ts-config' => true,
221223
),
@@ -230,6 +232,8 @@ protected function get_allowed_html(): array {
230232
'autocomplete' => true,
231233
// Tom Select data attributes (built-in Settings API feature).
232234
'data-wp-prefix' => true,
235+
'data-wp-action' => true,
236+
'data-wp-nonce' => true,
233237
'data-wp-endpoint' => true,
234238
'data-ts-config' => true,
235239
),

0 commit comments

Comments
 (0)