Changeset 2705068
- Timestamp:
- 04/05/2022 12:27:06 PM (3 years ago)
- Location:
- ad-invalid-click-protector/trunk/inc
- Files:
-
- 2 edited
-
admin_setup.php (modified) (1 diff)
-
banned_user_table.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ad-invalid-click-protector/trunk/inc/admin_setup.php
r2656496 r2705068 523 523 $bannedUserTableOBJ = new AICP_BANNED_USER_TABLE(); 524 524 $aicpOBJ = new AICP(); 525 if( 'delete'=== $bannedUserTableOBJ->current_action() ) {526 global $wpdb;527 $fetchedID = $_REQUEST['id'];528 if( is_array( $fetchedID ) ) { // for bulk operation arry will return529 $selectedID = implode( ',', array_fill( 0, count( $fetchedID ), '%d' ) );530 } else { //for singel delete just the id will return531 $selectedID = '%d';532 }533 if( empty( $selectedID ) ) {534 $this->delete_notice( false );535 } else {536 $query = $wpdb->prepare(537 "DELETE FROM {$aicpOBJ->table_name} WHERE {$aicpOBJ->table_name}.id IN ($selectedID)",538 $fetchedID539 );540 $wpdb->query( $query );541 $this->delete_notice( true );542 }543 }544 /* End of handelling the deletion process */545 /* Now it's time to show our data */525 if( ( 'delete'=== $bannedUserTableOBJ->current_action() ) && isset( $_REQUEST['nonce'] ) && wp_verify_nonce( $_REQUEST['nonce'], 'delete_banned_user' ) ) { 526 global $wpdb; 527 $fetchedID = $_REQUEST['id']; 528 if( is_array( $fetchedID ) ) { // for bulk operation arry will return 529 $selectedID = implode( ',', array_fill( 0, count( $fetchedID ), '%d' ) ); 530 } else { //for singel delete just the id will return 531 $selectedID = '%d'; 532 } 533 if( empty( $selectedID ) ) { 534 $this->delete_notice( false ); 535 } else { 536 $query = $wpdb->prepare( 537 "DELETE FROM {$aicpOBJ->table_name} WHERE {$aicpOBJ->table_name}.id IN ($selectedID)", 538 $fetchedID 539 ); 540 $wpdb->query( $query ); 541 $this->delete_notice( true ); 542 } 543 } 544 /* End of handelling the deletion process */ 545 /* Now it's time to show our data */ 546 546 ?> 547 547 <div class="wrap"> -
ad-invalid-click-protector/trunk/inc/banned_user_table.php
r1565011 r2705068 34 34 public function column_ip( $item ) { 35 35 $actions = array( 36 'delete' => sprintf( '<a class="aicp_delete" href="?page=%s&action=%s&id=%s ">Delete</a>', $_REQUEST['page'], 'delete', $item->id),36 'delete' => sprintf( '<a class="aicp_delete" href="?page=%s&action=%s&id=%s&nonce=%s">Delete</a>', $_REQUEST['page'], 'delete', $item->id, wp_create_nonce( 'delete_banned_user' ) ), 37 37 ); 38 38
Note: See TracChangeset
for help on using the changeset viewer.