All My Login Page

get_results($query); foreach ( $results as $row ) { wp_delete_attachment( $row->ID ); //delete the image and also delete the attachment from the Media Library. } delete_option('all_my_image_logo'); //delete image path from database. } if(isset($_POST['remove2'])){ global $wpdb; $img_path2 = $_POST['path2']; // We need to get the images meta ID. $query = "SELECT ID FROM wp_posts where guid = '" . esc_url($img_path2) . "' AND post_type = 'attachment'"; $results = $wpdb->get_results($query); // And delete it foreach ( $results as $row ) { wp_delete_attachment( $row->ID ); //delete the image and also delete the attachment from the Media Library. } delete_option('all_my_image_background'); //delete image path from database. } } } // End class AMLP::all_my_get_instance();