PluginProbe
HTML Forms – Simple WordPress Forms Plugin / 1.3.21
HTML Forms – Simple WordPress Forms Plugin v1.3.21
1.7.0 trunk 1.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.1 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.2.0 1.3.0 1.3.1 1.3.10 1.3.11 1.3.12 1.3.13 1.3.14 1.3.15 1.3.16 All 67 releases
← All changes | src/admin/class-admin.php +29 -314 1.7.01.3.21 View file →
@@ -22,16 +22,14 @@
22 22 }
23 23
24 24 public function hook() {
25 25 add_action( 'admin_menu', array( $this, 'menu' ) );
26 - add_action( 'admin_enqueue_scripts', array( $this, 'menu_icon' ) );
27 26 add_action( 'init', array( $this, 'register_settings' ) );
28 27 add_action( 'admin_init', array( $this, 'run_migrations' ) );
29 28 add_action( 'admin_init', array( $this, 'listen' ) );
30 29 add_action( 'admin_print_styles', array( $this, 'assets' ) );
31 30 add_action( 'admin_head', array( $this, 'add_screen_options' ) );
32 - add_action( 'hf_admin_action_create_form', array( $this, 'process_create_form' ) );
33 - add_action( 'wp_ajax_hf_dismiss_recaptcha_notice', array( $this, 'dismiss_recaptcha_notice' ) );
31 + add_action( 'hf_admin_action_create_form', array( $this, 'process_create_form' ) );
34 32 add_action( 'hf_admin_action_save_form', array( $this, 'process_save_form' ) );
35 33 add_action( 'hf_admin_action_bulk_delete_submissions', array( $this, 'process_bulk_delete_submissions' ) );
36 34
37 35 add_action( 'hf_admin_output_form_tab_fields', array( $this, 'tab_fields' ) );
@@ -40,25 +38,12 @@
40 38 add_action( 'hf_admin_output_form_tab_actions', array( $this, 'tab_actions' ) );
41 39 add_action( 'hf_admin_output_form_tab_submissions', array( $this, 'tab_submissions_list' ) );
42 40 add_action( 'hf_admin_output_form_tab_submissions', array( $this, 'tab_submissions_detail' ) );
43 41 add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_gutenberg_assets' ) );
44 - add_filter( 'set_screen_option_hf_submissions_per_page', function( $keep, $option, $value ) {
45 - return (int) $value;
46 - }, 10, 3 );
47 42 }
48 43
49 44 public function enqueue_gutenberg_assets() {
50 - wp_enqueue_script(
51 - 'html-forms-block',
52 - plugins_url( 'assets/js/gutenberg-block.js', $this->plugin_file ),
53 - array(
54 - 'wp-blocks',
55 - 'wp-i18n',
56 - 'wp-element',
57 - 'wp-components',
58 - 'wp-block-editor',
59 - )
60 - );
45 + wp_enqueue_script( 'html-forms-block', plugins_url( 'assets/js/gutenberg-block.js', $this->plugin_file ), array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-components' ) );
61 46 $forms = hf_get_forms();
62 47 $data = array();
63 48 foreach ( $forms as $form ) {
64 49 $data[] = array(
@@ -89,36 +74,11 @@
89 74 }
90 75
91 76 /**
92 77 * @param array $dirty
93 - *
94 78 * @return array
95 79 */
96 80 public function sanitize_settings( $dirty ) {
97 - $int_fields = array( 'enable_nonce', 'load_stylesheet', 'direct_links', 'media_library_uploads', 'maximum_filesize' );
98 - foreach ( $int_fields as $field ) {
99 - if ( isset( $dirty[ $field ] ) ) {
100 - $dirty[ $field ] = absint( $dirty[ $field ] );
101 - }
102 - }
103 -
104 - if ( isset( $dirty['wrapper_tag'] ) ) {
105 - $allowed_tags = array( 'p', 'div', 'span' );
106 - $dirty['wrapper_tag'] = in_array( $dirty['wrapper_tag'], $allowed_tags, true ) ? $dirty['wrapper_tag'] : 'p';
107 - }
108 -
109 - if ( isset( $dirty['submissions_export_delimiter'] ) ) {
110 - $dirty['submissions_export_delimiter'] = sanitize_text_field( $dirty['submissions_export_delimiter'] );
111 - }
112 -
113 - if ( isset( $dirty['google_recaptcha'] ) && is_array( $dirty['google_recaptcha'] ) ) {
114 - foreach ( array( 'site_key', 'secret_key' ) as $key ) {
115 - if ( isset( $dirty['google_recaptcha'][ $key ] ) ) {
116 - $dirty['google_recaptcha'][ $key ] = sanitize_text_field( $dirty['google_recaptcha'][ $key ] );
117 - }
118 - }
119 - }
120 -
121 81 return $dirty;
122 82 }
123 83
124 84 public function listen() {
@@ -163,12 +123,12 @@
163 123 if ( empty( $_GET['page'] ) || strpos( $_GET['page'], 'html-forms' ) !== 0 ) {
164 124 return;
165 125 }
166 126
167 - $settings = hf_get_settings();
127 + $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
168 128
169 - wp_enqueue_style( 'html-forms-admin', plugins_url( 'assets/css/admin.css', $this->plugin_file ), array(), HTML_FORMS_VERSION );
170 - wp_enqueue_script( 'html-forms-admin', plugins_url( 'assets/js/admin.js', $this->plugin_file ), array(), HTML_FORMS_VERSION, true );
129 + wp_enqueue_style( 'html-forms-admin', plugins_url( 'assets/css/admin' . $suffix . '.css', $this->plugin_file ), array(), HTML_FORMS_VERSION );
130 + wp_enqueue_script( 'html-forms-admin', plugins_url( 'assets/js/admin' . $suffix . '.js', $this->plugin_file ), array(), HTML_FORMS_VERSION, true );
171 131 wp_localize_script(
172 132 'html-forms-admin',
173 133 'hf_options',
174 134 array(
@@ -174,9 +134,8 @@
174 134 array(
175 135 'page' => $_GET['page'],
176 136 'view' => empty( $_GET['view'] ) ? '' : $_GET['view'],
177 137 'form_id' => empty( $_GET['form_id'] ) ? 0 : (int) $_GET['form_id'],
178 - 'wrapper_tag' => empty( $settings['wrapper_tag'] ) ? 'p' : $settings['wrapper_tag'],
179 138 )
180 139 );
181 140 }
182 141
@@ -181,79 +140,20 @@
181 140 }
182 141
183 142 public function menu() {
184 143 $capability = 'edit_forms';
185 -
186 - add_menu_page(
187 - 'HTML Forms',
188 - 'HTML Forms',
189 - $capability,
190 - 'html-forms',
191 - array(
192 - $this,
193 - 'page_overview',
194 - ),
195 - 'none',
196 - '99.88491'
197 - );
144 + $svg_icon = '<svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="256.000000pt" height="256.000000pt" viewBox="0 0 256.000000 256.000000" preserveAspectRatio="xMidYMid meet"><g transform="translate(0.000000,256.000000) scale(0.100000,-0.100000)"
145 + fill="#000000" stroke="none"><path d="M0 1280 l0 -1280 1280 0 1280 0 0 1280 0 1280 -1280 0 -1280 0 0 -1280z m2031 593 c8 -8 9 -34 4 -78 -6 -56 -9 -65 -23 -60 -43 16 -98 15 -132 -2 -50 -26 -72 -72 -78 -159 l-5 -74 92 0 91 0 0 -70 0 -70 -90 0 -90 0 0 -345 0 -345 -90 0 -90 0 0 345 0 345 -55 0 -55 0 0 70 0 70 55 0 55 0 0 38 c0 63 20 153 45 202 54 105 141 152 273 147 45 -2 87 -8 93 -14z m-1291 -288 l0 -235 230 0 230 0 0 235 0 235 90 0 90 0 0 -575 0 -575 -90 0 -90 0 0 260 0 260 -230 0 -230 0 0 -260 0 -260 -90 0 -90 0 0 575 0 575 90 0 90 0 0 -235z"/></g></svg>';
146 + add_menu_page( 'HTML Forms', 'HTML Forms', $capability, 'html-forms', array( $this, 'page_overview' ), 'data:image/svg+xml;base64,' . base64_encode( $svg_icon ), '99.88491' );
147 + add_submenu_page( 'html-forms', __( 'Forms', 'html-forms' ), __( 'All Forms', 'html-forms' ), $capability, 'html-forms', array( $this, 'page_overview' ) );
148 + add_submenu_page( 'html-forms', __( 'Add new form', 'html-forms' ), __( 'Add New', 'html-forms' ), $capability, 'html-forms-add-form', array( $this, 'page_new_form' ) );
149 + add_submenu_page( 'html-forms', __( 'Settings', 'html-forms' ), __( 'Settings', 'html-forms' ), $capability, 'html-forms-settings', array( $this, 'page_settings' ) );
198 150
199 - add_submenu_page(
200 - 'html-forms',
201 - __( 'Forms', 'html-forms' ),
202 - __( 'All Forms', 'html-forms' ),
203 - $capability,
204 - 'html-forms',
205 - array(
206 - $this,
207 - 'page_overview',
208 - )
209 - );
210 -
211 - add_submenu_page(
212 - 'html-forms',
213 - __( 'Add New Form', 'html-forms' ),
214 - __( 'Add New', 'html-forms' ),
215 - $capability,
216 - 'html-forms-add-form',
217 - array(
218 - $this,
219 - 'page_new_form',
220 - )
221 - );
222 -
223 - add_submenu_page(
224 - 'html-forms',
225 - __( 'Settings', 'html-forms' ),
226 - __( 'Settings', 'html-forms' ),
227 - $capability,
228 - 'html-forms-settings',
229 - array(
230 - $this,
231 - 'page_settings',
232 - )
233 - );
234 -
235 151 if ( ! defined( 'HF_PREMIUM_VERSION' ) ) {
236 - add_submenu_page(
237 - 'html-forms',
238 - 'Premium',
239 - '<span style="color: #ea6ea6;">Premium</span>',
240 - $capability,
241 - 'html-forms-premium',
242 - array(
243 - $this,
244 - 'page_premium',
245 - )
246 - );
152 + add_submenu_page( 'html-forms', 'Premium', '<span style="color: #ea6ea6;">Premium</span>', $capability, 'html-forms-premium', array( $this, 'page_premium' ) );
247 153 }
248 154 }
249 155
250 - public function menu_icon() {
251 - $html_forms_icon = 'data:image/svg+xml;base64,'.base64_encode('<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 256 256"><path d="M0 0v256h256V0zm203.1 68.7c.8.8.9 3.4.4 7.8-.6 5.6-.9 6.5-2.3 6-4.3-1.6-9.8-1.5-13.2.2-5 2.6-7.2 7.2-7.8 15.9l-.5 7.4H198v14h-18v69h-18v-69h-11v-14h11v-3.8c0-6.3 2-15.3 4.5-20.2 5.4-10.5 14.1-15.2 27.3-14.7 4.5.2 8.7.8 9.3 1.4M74 74v47h46V74h18v115h-18v-52H74v52H56V74z" /></svg>');
252 -
253 - wp_add_inline_style( 'wp-admin', '#toplevel_page_html-forms .wp-menu-image { background-color: currentColor; mask-image: url("'.$html_forms_icon.'"); mask-size: 20px; mask-repeat: no-repeat; mask-position: center; }' );
254 - }
255 -
256 156 public function add_screen_options() {
257 157 // only run on the submissions overview page (not detail)
258 158 if ( empty( $_GET['page'] ) || $_GET['page'] !== 'html-forms' || empty( $_GET['view'] ) || $_GET['view'] !== 'edit' || empty( $_GET['form_id'] ) || ! empty( $_GET['submission_id'] ) ) {
259 159 return;
@@ -269,24 +169,18 @@
269 169 $submissions = hf_get_form_submissions( $_GET['form_id'] );
270 170 $columns = $this->get_submission_columns( $submissions );
271 171 add_filter(
272 172 'manage_toplevel_page_html-forms_columns',
273 - function ( $unused ) use ( $columns ) {
173 + function( $unused ) use ( $columns ) {
274 174 return $columns;
275 175 }
276 176 );
277 177 add_screen_option( 'layout_columns' );
278 - add_screen_option( 'per_page', array(
279 - 'label' => __( 'Submissions per page', 'html-forms' ),
280 - 'default' => 20,
281 - 'option' => 'hf_submissions_per_page',
282 - ) );
283 178 }
284 179
285 180 public function page_overview() {
286 181 if ( ! empty( $_GET['view'] ) && $_GET['view'] === 'edit' ) {
287 182 $this->page_edit_form();
288 -
289 183 return;
290 184 }
291 185
292 186 $settings = hf_get_settings();
@@ -302,10 +196,8 @@
302 196 }
303 197
304 198 public function page_settings() {
305 199 $settings = hf_get_settings();
306 - $wrapper_tags = array ( 'p', 'div', 'span' );
307 -
308 200 require dirname( $this->plugin_file ) . '/views/page-global-settings.php';
309 201 }
310 202
311 203 public function page_premium() {
@@ -356,9 +248,8 @@
356 248 $columns[ $field ] = esc_html( ucfirst( strtolower( str_replace( '_', ' ', $field ) ) ) );
357 249 }
358 250 }
359 251 }
360 -
361 252 return $columns;
362 253 }
363 254
364 255 public function tab_submissions_list( Form $form ) {
@@ -365,33 +256,9 @@
365 256 if ( ! empty( $_GET['submission_id'] ) ) {
366 257 return;
367 258 }
368 259
369 - $items_per_page = (int) get_user_option( 'hf_submissions_per_page' );
370 - if ( $items_per_page < 1 ) {
371 - $items_per_page = 20;
372 - }
373 -
374 - $allowed_orderby = array( 'submitted_at' );
375 - $orderby = isset( $_GET['orderby'] ) && in_array( $_GET['orderby'], $allowed_orderby, true ) ? $_GET['orderby'] : 'submitted_at';
376 - $order = isset( $_GET['order'] ) && strtolower( $_GET['order'] ) === 'asc' ? 'asc' : 'desc';
377 - $search = isset( $_GET['s'] ) ? sanitize_text_field( wp_unslash( $_GET['s'] ) ) : '';
378 -
379 - $total_items = hf_count_form_submissions( $form->ID, $search );
380 - $total_pages = max( 1, ceil( $total_items / $items_per_page ) );
381 - $current_page = isset( $_GET['paged'] ) ? intval( $_GET['paged'] ) : 1;
382 - $current_page = max( 1, $current_page );
383 - $current_page = min( $total_pages, $current_page );
384 - $submissions = hf_get_form_submissions(
385 - $form->ID,
386 - array(
387 - 'limit' => $items_per_page,
388 - 'offset' => ( $current_page - 1 ) * $items_per_page,
389 - 'orderby' => $orderby,
390 - 'order' => $order,
391 - 'search' => $search,
392 - )
393 - );
260 + $submissions = hf_get_form_submissions( $form->ID );
394 261 $columns = $this->get_submission_columns( $submissions );
395 262 $hidden_columns = get_hidden_columns( get_current_screen() );
396 263
397 264 require dirname( $this->plugin_file ) . '/views/tab-submissions-list.php';
@@ -402,12 +269,12 @@
402 269 return;
403 270 }
404 271
405 272 $submission = hf_get_form_submission( (int) $_GET['submission_id'] );
406 - do_action( 'hf_admin_form_submissions_detail', $submission );
407 273 require dirname( $this->plugin_file ) . '/views/tab-submissions-detail.php';
408 274 }
409 275
276 +
410 277 public function process_create_form() {
411 278 // Fix for MultiSite stripping KSES for roles other than administrator
412 279 remove_all_filters( 'content_save_pre' );
413 280
@@ -433,13 +300,8 @@
433 300
434 301 // Fix for MultiSite stripping KSES for roles other than administrator
435 302 remove_all_filters( 'content_save_pre' );
436 303
437 - // run our own kses filter
438 - if ( ! current_user_can( 'unfiltered_html' ) ) {
439 - $data['markup'] = $this->kses( $data['markup'] );
440 - }
441 -
442 304 // strip <form> tag from markup
443 305 $data['markup'] = preg_replace( '/<\/?form(.|\s)*?>/i', '', $data['markup'] );
444 306
445 307 $form_id = wp_insert_post(
@@ -453,26 +315,14 @@
453 315 )
454 316 );
455 317
456 318 if ( ! empty( $data['settings'] ) ) {
457 - // Reject redirect URLs with non-http(s) schemes
458 - if ( isset( $data['settings']['redirect_url'] ) && $data['settings']['redirect_url'] !== '' ) {
459 - $scheme = wp_parse_url( $data['settings']['redirect_url'], PHP_URL_SCHEME );
460 - if ( $scheme !== null && ! in_array( strtolower( $scheme ), array( 'http', 'https' ), true ) ) {
461 - $data['settings']['redirect_url'] = '';
462 - }
463 - }
464 -
465 319 update_post_meta( $form_id, '_hf_settings', $data['settings'] );
466 320 }
467 321
468 322 // save form messages in individual meta keys
469 323 foreach ( $data['messages'] as $key => $message ) {
470 - if ( current_user_can( 'unfiltered_html' ) ) {
471 - update_post_meta( $form_id, 'hf_message_' . $key, $message );
472 - } else {
473 - update_post_meta( $form_id, 'hf_message_' . $key, wp_kses_post( $message ) );
474 - }
324 + update_post_meta( $form_id, 'hf_message_' . $key, $message );
475 325 }
476 326
477 327 $redirect_url_args = array(
478 328 'form_id' => $form_id,
@@ -485,36 +335,15 @@
485 335
486 336 /**
487 337 * Get URL for a tab on the current page.
488 338 *
339 + * @since 3.0
340 + * @internal
489 341 * @param $tab
490 - *
491 342 * @return string
492 - * @since 3.0
493 - * @internal
494 343 */
495 344 public function get_tab_url( $tab ) {
496 - $tab_url = add_query_arg( array( 'tab' => $tab ), remove_query_arg( 'tab' ) );
497 -
498 - $url_parts = parse_url($tab_url);
499 - if ( isset( $url_parts['query'] ) ) {
500 - parse_str( $url_parts['query'], $query_params );
501 -
502 - if ( isset( $query_params['submission_id'] ) ) {
503 - unset( $query_params['submission_id'] );
504 - }
505 -
506 - $new_query = http_build_query( $query_params );
507 - $new_tab_url = $url_parts['path'];
508 -
509 - if ( ! empty( $new_query ) ) {
510 - $new_tab_url .= '?' . $new_query;
511 - }
512 -
513 - return $new_tab_url;
514 - }
515 -
516 - return $tab_url;
345 + return add_query_arg( array( 'tab' => $tab ), remove_query_arg( 'tab' ) );
517 346 }
518 347
519 348 /**
520 349 * @return array
@@ -538,136 +367,22 @@
538 367 if ( empty( $_POST['id'] ) ) {
539 368 return;
540 369 }
541 370
542 - $args = array_map( 'intval', $_POST['id'] );
543 - $table = $wpdb->prefix . 'hf_submissions';
544 - $placeholders = rtrim( str_repeat( '%d,', count( $args ) ), ',' );
545 - $wpdb->query( $wpdb->prepare( "DELETE FROM {$table} WHERE id IN( {$placeholders} );", $args ) );
371 + $ids = $_POST['id'];
372 + $table = $wpdb->prefix . 'hf_submissions';
373 + $ids = join( ',', array_map( 'esc_sql', $ids ) );
374 + $wpdb->query( sprintf( "DELETE FROM {$table} WHERE id IN( %s );", $ids ) );
375 + $wpdb->query( sprintf( "DELETE FROM {$wpdb->postmeta} WHERE post_id IN ( %s ) AND meta_key LIKE '_hf_%%';", $ids ) );
546 376 }
547 377
548 378 private function get_default_form_content() {
549 - $settings = hf_get_settings();
550 - $wrapper_tag = ( isset( $settings['wrapper_tag'] ) ) ? $settings['wrapper_tag'] : 'p';
551 -
552 379 $html = '';
553 - $html .= sprintf( "<%1\$s>\n\t<label>%2\$s</label>\n\t<input type=\"text\" name=\"NAME\" placeholder=\"%2\$s\" required />\n</%1\$s>", $wrapper_tag, __( 'Your name', 'html-forms' ) ) . PHP_EOL;
554 - $html .= sprintf( "<%1\$s>\n\t<label>%2\$s</label>\n\t<input type=\"email\" name=\"EMAIL\" placeholder=\"%2\$s\" required />\n</%1\$s>", $wrapper_tag, __( 'Your email', 'html-forms' ) ) . PHP_EOL;
555 - $html .= sprintf( "<%1\$s>\n\t<label>%2\$s</label>\n\t<input type=\"text\" name=\"SUBJECT\" placeholder=\"%2\$s\" required />\n</%1\$s>", $wrapper_tag, __( 'Subject', 'html-forms' ) ) . PHP_EOL;
556 - $html .= sprintf( "<%1\$s>\n\t<label>%2\$s</label>\n\t<textarea name=\"MESSAGE\" placeholder=\"%2\$s\" required></textarea>\n</%1\$s>", $wrapper_tag, __( 'Message', 'html-forms' ) ) . PHP_EOL;
557 - $html .= sprintf( "<%1\$s>\n\t<input type=\"submit\" value=\"%2\$s\" />\n</%1\$s>", $wrapper_tag, __( 'Send', 'html-forms' ) );
558 -
380 + $html .= sprintf( "<p>\n\t<label>%1\$s</label>\n\t<input type=\"text\" name=\"NAME\" placeholder=\"%1\$s\" required />\n</p>", __( 'Your name', 'html-forms' ) ) . PHP_EOL;
381 + $html .= sprintf( "<p>\n\t<label>%1\$s</label>\n\t<input type=\"email\" name=\"EMAIL\" placeholder=\"%1\$s\" required />\n</p>", __( 'Your email', 'html-forms' ) ) . PHP_EOL;
382 + $html .= sprintf( "<p>\n\t<label>%1\$s</label>\n\t<input type=\"text\" name=\"SUBJECT\" placeholder=\"%1\$s\" required />\n</p>", __( 'Subject', 'html-forms' ) ) . PHP_EOL;
383 + $html .= sprintf( "<p>\n\t<label>%1\$s</label>\n\t<textarea name=\"MESSAGE\" placeholder=\"%1\$s\" required></textarea>\n</p>", __( 'Message', 'html-forms' ) ) . PHP_EOL;
384 + $html .= sprintf( "<p>\n\t<input type=\"submit\" value=\"%s\" />\n</p>", __( 'Send', 'html-forms' ) );
559 385 return $html;
560 386 }
561 387
562 - /**
563 - * Filters string and strips out all HTML tags and attributes, except what's in our whitelist.
564 - *
565 - * @param string $string The string to apply KSES whitelist on
566 - * @return string
567 - */
568 - private function kses( $string ) {
569 - $always_allowed_attr = array_fill_keys(
570 - array(
571 - 'aria-describedby',
572 - 'aria-details',
573 - 'aria-label',
574 - 'aria-labelledby',
575 - 'aria-hidden',
576 - 'aria-*',
577 - 'class',
578 - 'id',
579 - 'style',
580 - 'title',
581 - 'role',
582 - 'data-*',
583 - 'data-confirm',
584 - 'tabindex',
585 - ),
586 - true
587 - );
588 - $input_allowed_attr = array_merge(
589 - $always_allowed_attr,
590 - array_fill_keys(
591 - array(
592 - 'type',
593 - 'required',
594 - 'placeholder',
595 - 'value',
596 - 'name',
597 - 'step',
598 - 'min',
599 - 'max',
600 - 'checked',
601 - 'width',
602 - 'autocomplete',
603 - 'autofocus',
604 - 'minlength',
605 - 'maxlength',
606 - 'size',
607 - 'pattern',
608 - 'disabled',
609 - 'readonly',
610 - ),
611 - true
612 - )
613 - );
614 -
615 - $allowed = array(
616 - 'p' => $always_allowed_attr,
617 - 'label' => array_merge( $always_allowed_attr, array( 'for' => true ) ),
618 - 'input' => $input_allowed_attr,
619 - 'button' => $input_allowed_attr,
620 - 'fieldset' => $always_allowed_attr,
621 - 'legend' => $always_allowed_attr,
622 - 'ul' => $always_allowed_attr,
623 - 'ol' => $always_allowed_attr,
624 - 'li' => $always_allowed_attr,
625 - 'select' => array_merge( $input_allowed_attr, array( 'multiple' => true ) ),
626 - 'option' => array_merge( $input_allowed_attr, array( 'selected' => true ) ),
627 - 'optgroup' => array(
628 - 'disabled' => true,
629 - 'label' => true,
630 - ),
631 - 'textarea' => array_merge(
632 - $input_allowed_attr,
633 - array(
634 - 'rows' => true,
635 - 'cols' => true,
636 - )
637 - ),
638 - 'div' => $always_allowed_attr,
639 - 'strong' => $always_allowed_attr,
640 - 'b' => $always_allowed_attr,
641 - 'i' => $always_allowed_attr,
642 - 'br' => array(),
643 - 'em' => $always_allowed_attr,
644 - 'span' => $always_allowed_attr,
645 - 'a' => array_merge( $always_allowed_attr, array( 'href' => true ) ),
646 - 'img' => array_merge(
647 - $always_allowed_attr,
648 - array(
649 - 'src' => true,
650 - 'alt' => true,
651 - 'width' => true,
652 - 'height' => true,
653 - 'srcset' => true,
654 - 'sizes' => true,
655 - 'referrerpolicy' => true,
656 - 'loading' => true,
657 - 'decoding' => true,
658 - )
659 - ),
660 - 'u' => $always_allowed_attr,
661 - 'table' => $always_allowed_attr,
662 - 'tr' => $always_allowed_attr,
663 - 'td' => $always_allowed_attr,
664 - 'th' => $always_allowed_attr,
665 - 'thead' => $always_allowed_attr,
666 - 'tbody' => $always_allowed_attr,
667 - 'picture' => $always_allowed_attr,
668 - 'video' => $always_allowed_attr,
669 - );
670 -
671 - return wp_kses( $string, $allowed );
672 - }
673 388 }