← All changes
|
includes/lists/class-poll-maker-each-results-poll-list-table.php
+23
-23
5.6.1
→
6.5.1
View file →
| @@ -7,10 +7,10 @@ | ||
| 7 | 7 | /** Class constructor */ |
| 8 | 8 | public function __construct( $plugin_name ) { |
| 9 | 9 | $this->plugin_name = $plugin_name; |
| 10 | 10 | parent::__construct(array( |
| 11 | - 'singular' => __('Each result', "poll-maker"), //singular name of the listed records | |
| 12 | - 'plural' => __('Each results', "poll-maker"), //plural name of the listed records | |
| 11 | + 'singular' =>esc_html__('Each result', "poll-maker"), //singular name of the listed records | |
| 12 | + 'plural' =>esc_html__('Each results', "poll-maker"), //plural name of the listed records | |
| 13 | 13 | 'ajax' => false //does this table support ajax? |
| 14 | 14 | )); |
| 15 | 15 | add_action('admin_notices', array($this, 'eachresults_notices')); |
| 16 | 16 | |
| @@ -285,9 +285,9 @@ | ||
| 285 | 285 | case 'unread': |
| 286 | 286 | return $item[$column_name]; |
| 287 | 287 | break; |
| 288 | 288 | case 'user_id': |
| 289 | - $user = __("Guest", "poll-maker"); | |
| 289 | + $user =esc_html__("Guest", "poll-maker"); | |
| 290 | 290 | if (!empty($item[$column_name]) && $item[$column_name] > 0) { |
| 291 | 291 | $user = get_user_by('ID', $item[$column_name]) ? get_user_by('ID', $item[$column_name])->display_name : ''; |
| 292 | 292 | } |
| 293 | 293 | return $user; |
| @@ -387,17 +387,17 @@ | ||
| 387 | 387 | */ |
| 388 | 388 | function get_columns() { |
| 389 | 389 | $columns = array( |
| 390 | 390 | 'cb' => '<input type="checkbox" />', |
| 391 | - 'answer_id' => __('Answer', "poll-maker"), | |
| 392 | - 'user_ip' => __('User IP', "poll-maker"), | |
| 393 | - 'user_id' => __('WP User', "poll-maker"), | |
| 394 | - 'user_email' => __('User Email', "poll-maker"), | |
| 395 | - 'user_name' => __('User Name', "poll-maker"), | |
| 396 | - 'user_phone' => __('User Phone', "poll-maker"), | |
| 397 | - 'vote_date' => __('Vote Datetime', "poll-maker"), | |
| 398 | - 'vote_reason' => __('Vote Reason', "poll-maker"), | |
| 399 | - 'unread' => __('Read Status', "poll-maker") | |
| 391 | + 'answer_id' =>esc_html__('Answer', "poll-maker"), | |
| 392 | + 'user_ip' =>esc_html__('User IP', "poll-maker"), | |
| 393 | + 'user_id' =>esc_html__('WP User', "poll-maker"), | |
| 394 | + 'user_email' =>esc_html__('User Email', "poll-maker"), | |
| 395 | + 'user_name' =>esc_html__('User Name', "poll-maker"), | |
| 396 | + 'user_phone' =>esc_html__('User Phone', "poll-maker"), | |
| 397 | + 'vote_date' =>esc_html__('Vote Datetime', "poll-maker"), | |
| 398 | + 'vote_reason' =>esc_html__('Vote Reason', "poll-maker"), | |
| 399 | + 'unread' =>esc_html__('Read Status', "poll-maker") | |
| 400 | 400 | ); |
| 401 | 401 | |
| 402 | 402 | return $columns; |
| 403 | 403 | } |
| @@ -430,10 +430,10 @@ | ||
| 430 | 430 | * @return array |
| 431 | 431 | */ |
| 432 | 432 | public function get_bulk_actions() { |
| 433 | 433 | $actions = array( |
| 434 | - 'bulk-read' => __('Mark as read', "poll-maker"), | |
| 435 | - 'bulk-delete' => __('Delete', "poll-maker"), | |
| 434 | + 'bulk-read' =>esc_html__('Mark as read', "poll-maker"), | |
| 435 | + 'bulk-delete' =>esc_html__('Delete', "poll-maker"), | |
| 436 | 436 | ); |
| 437 | 437 | |
| 438 | 438 | return $actions; |
| 439 | 439 | } |
| @@ -507,15 +507,15 @@ | ||
| 507 | 507 | // If the delete bulk action is triggered |
| 508 | 508 | if ((isset($_POST['action']) && $_POST['action'] == 'bulk-delete') |
| 509 | 509 | || (isset($_POST['action2']) && $_POST['action2'] == 'bulk-delete') |
| 510 | 510 | ) { |
| 511 | - $delete_ids = esc_sql($_POST['bulk-action']); | |
| 512 | - | |
| 513 | - // loop over the array of record IDs and delete them | |
| 514 | - foreach ( $delete_ids as $id ) { | |
| 515 | - self::delete_reports($id); | |
| 511 | + if (!empty($_POST['bulk-action']) && is_array($_POST['bulk-action'])) { | |
| 512 | + $delete_ids = array_map('intval', $_POST['bulk-action']); | |
| 513 | + | |
| 514 | + foreach ($delete_ids as $id) { | |
| 515 | + self::delete_reports($id); | |
| 516 | + } | |
| 516 | 517 | } |
| 517 | - | |
| 518 | 518 | $message = 'deleted'; |
| 519 | 519 | $url = esc_url_raw(remove_query_arg(['action', 'result', '_wpnonce'])) . '&ays_poll_tab_results=tab2' . '&status=' . $message; |
| 520 | 520 | wp_redirect($url); |
| 521 | 521 | } elseif ((isset($_POST['action']) && $_POST['action'] == 'bulk-read') |
| @@ -543,12 +543,12 @@ | ||
| 543 | 543 | return; |
| 544 | 544 | } |
| 545 | 545 | |
| 546 | 546 | if ('deleted' == $status) { |
| 547 | - $updated_message = esc_html(__('Result(s) deleted.', "poll-maker")); | |
| 547 | + $updated_message = esc_html( esc_html__('Result(s) deleted.', "poll-maker")); | |
| 548 | 548 | } |
| 549 | 549 | if ('read' == $status) { |
| 550 | - $updated_message = esc_html(__('Result(s) marked as read.', "poll-maker")); | |
| 550 | + $updated_message = esc_html( esc_html__('Result(s) marked as read.', "poll-maker")); | |
| 551 | 551 | } |
| 552 | 552 | |
| 553 | 553 | if (empty($updated_message)) { |
| 554 | 554 | return; |
| @@ -554,9 +554,9 @@ | ||
| 554 | 554 | return; |
| 555 | 555 | } |
| 556 | 556 | |
| 557 | 557 | ?> |
| 558 | - <div class="notice notice-success is-dismissible"> | |
| 558 | + <div class="ays-poll-admin-notice notice notice-success is-dismissible"> | |
| 559 | 559 | <p> |
| 560 | 560 | <?php echo $updated_message; ?> |
| 561 | 561 | </p> |
| 562 | 562 | </div> |