... | ... |
@@ -14,7 +14,7 @@ class admin_list_table extends WP_List_Table { |
14 | 14 |
)); |
15 | 15 |
} |
16 | 16 |
|
17 |
- public function get_customers($per_page = 5, $page_number = 1) { |
|
17 |
+ public function get_item_data($per_page = 5, $page_number = 1) { |
|
18 | 18 |
global $wpdb; |
19 | 19 |
|
20 | 20 |
$sql = "SELECT * FROM {$wpdb->prefix}customers"; |
... | ... |
@@ -32,7 +32,7 @@ class admin_list_table extends WP_List_Table { |
32 | 32 |
return $result; |
33 | 33 |
} |
34 | 34 |
|
35 |
- public function delete_customer($id) { |
|
35 |
+ public function delete_item($id) { |
|
36 | 36 |
global $wpdb; |
37 | 37 |
|
38 | 38 |
$wpdb->delete( |
... | ... |
@@ -66,7 +66,7 @@ class admin_list_table extends WP_List_Table { |
66 | 66 |
} |
67 | 67 |
|
68 | 68 |
function column_name($item) { |
69 |
- $delete_nonce = wp_create_nonce('delete_customer'); |
|
69 |
+ $delete_nonce = wp_create_nonce('delete_item'); |
|
70 | 70 |
|
71 | 71 |
$title = '<strong>' . $item['name'] . '</strong>'; |
72 | 72 |
|
... | ... |
@@ -118,18 +118,18 @@ class admin_list_table extends WP_List_Table { |
118 | 118 |
'per_page' => $per_page //WE have to determine how many items to show on a page |
119 | 119 |
)); |
120 | 120 |
|
121 |
- $this->items = $this->get_customers($per_page, $current_page); |
|
121 |
+ $this->items = $this->get_item_data($per_page, $current_page); |
|
122 | 122 |
} |
123 | 123 |
|
124 | 124 |
public function process_bulk_action() { |
125 | 125 |
if ('delete' === $this->current_action()) { |
126 | 126 |
$nonce = esc_attr($_REQUEST['_wpnonce']); |
127 | 127 |
|
128 |
- if (! wp_verify_nonce($nonce, 'delete_customer')) { |
|
128 |
+ if (! wp_verify_nonce($nonce, 'delete_item')) { |
|
129 | 129 |
die('Go get a life script kiddies'); |
130 | 130 |
} |
131 | 131 |
else { |
132 |
- $this->delete_customer(absint($_GET['customer'])); |
|
132 |
+ $this->delete_item(absint($_GET['customer'])); |
|
133 | 133 |
} |
134 | 134 |
} |
135 | 135 |
|
... | ... |
@@ -138,7 +138,7 @@ class admin_list_table extends WP_List_Table { |
138 | 138 |
$delete_ids = esc_sql($_POST['bulk-delete']); |
139 | 139 |
|
140 | 140 |
foreach ($delete_ids as $id) { |
141 |
- $this->delete_customer($id); |
|
141 |
+ $this->delete_item($id); |
|
142 | 142 |
} |
143 | 143 |
} |
144 | 144 |
} |