WordPress unexpected $wpdb error

I am trying to develop my first WP full plugin / widget example. My problem occurs when I added a function to delete plugin table from database. But when I delete my plugin, an error shown unexpected $wpdb. I didn’t understand exactly the problem, I used almost the same function to create table.

I am sorry because I am new in the WordPress development plugins.

Related posts

1 comment

  1. Call the $wpdb global variable by adding this code to the top of your delete function:

    global $wpdb;
    

Comments are closed.