| @@ -380,18 +380,15 @@ | ||
| 380 | 380 | $post_type = 'post'; |
| 381 | 381 | $source_name = 'post_type'; |
| 382 | 382 | $paged = absint( $_POST['page'] ?? 1 ); |
| 383 | 383 | if ( ! empty( $_POST['post_type'] ) ) { |
| 384 | - // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash | |
| 385 | 384 | $post_type = sanitize_text_field( $_POST['post_type'] ); |
| 386 | 385 | } |
| 387 | 386 | |
| 388 | 387 | if ( ! empty( $_POST['source_name'] ) ) { |
| 389 | - // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash | |
| 390 | 388 | $source_name = sanitize_text_field( $_POST['source_name'] ); |
| 391 | 389 | } |
| 392 | 390 | |
| 393 | - // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash | |
| 394 | 391 | $search = ! empty( $_POST['search'] ) ? sanitize_text_field( $_POST['search'] ) : ''; |
| 395 | 392 | $results = $post_list = []; |
| 396 | 393 | switch ( $source_name ) { |
| 397 | 394 | case 'taxonomy': |
| @@ -459,14 +456,13 @@ | ||
| 459 | 456 | if ( empty( $_POST['id'] ) ) { |
| 460 | 457 | wp_send_json_error( [] ); |
| 461 | 458 | } |
| 462 | 459 | |
| 463 | - // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized | |
| 464 | 460 | if ( empty( array_filter( $_POST['id'] ) ) ) { |
| 465 | 461 | wp_send_json_error( [] ); |
| 466 | 462 | } |
| 467 | 463 | $ids = array_map( 'intval', $_POST['id'] ); |
| 468 | - $source_name = ! empty( $_POST['source_name'] ) ? sanitize_text_field( $_POST['source_name'] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash | |
| 464 | + $source_name = ! empty( $_POST['source_name'] ) ? sanitize_text_field( $_POST['source_name'] ) : ''; | |
| 469 | 465 | |
| 470 | 466 | switch ( $source_name ) { |
| 471 | 467 | case 'taxonomy': |
| 472 | 468 | $args = [ |
| @@ -475,11 +471,9 @@ | ||
| 475 | 471 | 'order' => 'ASC', |
| 476 | 472 | 'include' => implode( ',', $ids ), |
| 477 | 473 | ]; |
| 478 | 474 | |
| 479 | - // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated | |
| 480 | 475 | if ( $_POST['post_type'] !== 'all' ) { |
| 481 | - // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated, WordPress.Security.ValidatedSanitizedInput.MissingUnslash | |
| 482 | 476 | $args['taxonomy'] = sanitize_text_field( $_POST['post_type'] ); |
| 483 | 477 | } |
| 484 | 478 | |
| 485 | 479 | $response = wp_list_pluck( get_terms( $args ), 'name', 'term_id' ); |
| @@ -497,9 +491,9 @@ | ||
| 497 | 491 | break; |
| 498 | 492 | default: |
| 499 | 493 | $post_info = get_posts( |
| 500 | 494 | [ |
| 501 | - 'post_type' => sanitize_text_field( $_POST['post_type'] ), // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotValidated | |
| 495 | + 'post_type' => sanitize_text_field( $_POST['post_type'] ), | |
| 502 | 496 | 'include' => implode( ',', $ids ), |
| 503 | 497 | ] |
| 504 | 498 | ); |
| 505 | 499 | $response = wp_list_pluck( $post_info, 'post_title', 'ID' ); |