[wp-hackers] register_activation_hook() problem

Austin Matzko if.website at gmail.com
Tue Jul 28 16:18:33 UTC 2009

On Tue, Jul 28, 2009 at 11:01 AM, Adam Taylor<adamjctaylor at gmail.com> wrote:
> I'm pretty sure I haven't defined the function more than once.. the whole
> code is here:
> http://pastebin.com/m1feb2d16

The problem is that the createDatabaseTables() method calls
$wpdb->get_var() without declaring $wpdb as a global variable, so the
error is calling a method that doesn't exist.

So line 62 needs global $wpdb, like so:

function createDatabaseTables() {
   global $wpdb;

More information about the wp-hackers mailing list