Skip to content

Commit 79ab22b

Browse files
committed
use GET request and pinch of styling
Signed-off-by: Filip Ilic <ilic.filip@gmail.com>
1 parent 56d9da1 commit 79ab22b

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

admin/admin.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ public function ajax_search_users(): void {
302302
\wp_send_json_error( 'Unauthorized' );
303303
}
304304

305-
$search = isset( $_POST['search'] ) ? \sanitize_text_field( \wp_unslash( $_POST['search'] ) ) : '';
305+
$search = isset( $_GET['search'] ) ? \sanitize_text_field( \wp_unslash( $_GET['search'] ) ) : '';
306306

307307
if ( \strlen( $search ) < 2 ) {
308308
\wp_send_json_success( [] );
@@ -403,6 +403,11 @@ public function enqueue( $hook_suffix ): void {
403403
'nonce' => \wp_create_nonce( 'ch_search_users_nonce' ),
404404
]
405405
);
406+
407+
\wp_add_inline_style(
408+
'wp-admin',
409+
'#comment_notification_recipient_results li { padding: 5px; margin: 0; cursor: pointer; } #comment_notification_recipient_results li:hover { background: #f0f0f1; }'
410+
);
406411
}
407412
}
408413

admin/assets/js/user-search.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jQuery( document ).ready( function( $ ) {
1919
searchTimer = setTimeout( function() {
2020
$.ajax( {
2121
url: chUserSearch.ajax_url,
22-
type: "POST",
22+
type: "GET",
2323
data: {
2424
action: "ch_search_users",
2525
search: query,

0 commit comments

Comments
 (0)