|
14 | 14 | * @var Manage_Menu $this |
15 | 15 | */ |
16 | 16 |
|
17 | | -$search_query = isset( $_REQUEST['cloud_search'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['cloud_search'] ) ) : ''; |
18 | | -$cloud_select = sanitize_key( wp_unslash( $_REQUEST['cloud_select'] ?? '' ) ); |
| 17 | +$code_snippets_search_query = isset( $_REQUEST['cloud_search'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['cloud_search'] ) ) : ''; |
| 18 | +$code_snippets_cloud_select = sanitize_key( wp_unslash( $_REQUEST['cloud_select'] ?? '' ) ); |
19 | 19 |
|
20 | 20 | ?> |
21 | 21 |
|
|
30 | 30 | <form method="get" action="" id="cloud-search-form"> |
31 | 31 | <?php List_Table::required_form_fields( 'search_box' ); ?> |
32 | 32 | <label class="screen-reader-text" for="cloud_search"> |
33 | | - <?php esc_html_e( 'Search cloud snippets', 'code-snippets' ); ?> |
34 | | - </label> |
35 | | - <?php |
36 | | - if ( isset( $_REQUEST['type'] ) ) { |
37 | | - printf( '<input type="hidden" name="type" value="%s">', esc_attr( sanitize_text_field( wp_unslash( $_REQUEST['type'] ) ) ) ); |
| 33 | + <?php esc_html_e( 'Search cloud snippets', 'code-snippets' ); ?> |
| 34 | + </label> |
| 35 | + <?php |
| 36 | + if ( isset( $_REQUEST['type'] ) ) { |
| 37 | + printf( '<input type="hidden" name="type" value="%s">', esc_attr( sanitize_text_field( wp_unslash( $_REQUEST['type'] ) ) ) ); |
38 | 38 | } |
39 | 39 | ?> |
40 | 40 | <div class="heading-box"> |
41 | 41 | <p class="cloud-search-heading"> |
42 | 42 | <label for="cloud-select-prepend"><?php esc_html_e( 'Search Cloud', 'code-snippets' ); ?></label> |
43 | 43 | </p> |
44 | | - </div> |
45 | | - <div class="input-group"> |
46 | | - <select id="cloud-select-prepend" class="select-prepend" name="cloud_select"> |
47 | | - <option value="term"<?php selected( $cloud_select, 'term' ); ?>> |
48 | | - <?php esc_html_e( 'Search by keyword(s)', 'code-snippets' ); ?> |
49 | | - </option> |
50 | | - <option value="codevault"<?php selected( $cloud_select, 'codevault' ); ?>> |
51 | | - <?php esc_html_e( 'Name of codevault', 'code-snippets' ); ?> |
52 | | - </option> |
53 | | - </select> |
54 | | - <input type="text" id="cloud_search" name="cloud_search" class="cloud_search" |
55 | | - value="<?php echo esc_html( $search_query ); ?>" |
56 | | - placeholder="<?php esc_attr_e( 'e.g. Remove unused javascript…', 'code-snippets' ); ?>"> |
| 44 | + </div> |
| 45 | + <div class="input-group"> |
| 46 | + <select id="cloud-select-prepend" class="select-prepend" name="cloud_select"> |
| 47 | + <option value="term"<?php selected( $code_snippets_cloud_select, 'term' ); ?>> |
| 48 | + <?php esc_html_e( 'Search by keyword(s)', 'code-snippets' ); ?> |
| 49 | + </option> |
| 50 | + <option value="codevault"<?php selected( $code_snippets_cloud_select, 'codevault' ); ?>> |
| 51 | + <?php esc_html_e( 'Name of codevault', 'code-snippets' ); ?> |
| 52 | + </option> |
| 53 | + </select> |
| 54 | + <input type="text" id="cloud_search" name="cloud_search" class="cloud_search" |
| 55 | + value="<?php echo esc_html( $code_snippets_search_query ); ?>" |
| 56 | + placeholder="<?php esc_attr_e( 'e.g. Remove unused javascript…', 'code-snippets' ); ?>"> |
57 | 57 |
|
58 | | - <button type="submit" id="cloud-search-submit" class="button"> |
| 58 | + <button type="submit" id="cloud-search-submit" class="button"> |
59 | 59 | <?php esc_html_e( 'Search Cloud', 'code-snippets' ); ?> |
60 | 60 | <span class="dashicons dashicons-search cloud-search"></span> |
61 | 61 | </button> |
|
68 | 68 | <?php |
69 | 69 | List_Table::required_form_fields(); |
70 | 70 |
|
71 | | - if ( $search_query ) { |
| 71 | + if ( $code_snippets_search_query ) { |
72 | 72 | $this->cloud_search_list_table->display(); |
73 | 73 | } |
74 | 74 |
|
|
0 commit comments