register_activation_hook error on oop plugin
-
Hi, I am writing a new plugin based on a none-wordpress class that I have once created.
On my main plugin page I have an install function, that I wish to hook to the plugin registration action with register_activation_hook.So inside the class my function name is: ztree_install.
This is my code:if( class_exists( 'Ztree_plugin' ) ) { global $wpdb; $the_ztree = new Ztree_plugin($wpdb); register_activation_hook( __FILE__, array( &$the_ztree, 'ztree_installl' ); }
But at activating the plugin I get an error message:
“Warning: call_user_func_array(): First argument is expected to be a valid callback, ‘create_books’ was given in /mnt/sites/matomysendbox.com/htdocs/wp-includes/plugin.php on line 405 Parse error: syntax error, unexpected ‘;’ in /mnt/sites/matomysendbox.com/htdocs/wp-content/plugins/ztree_forum/ztree_forum.php on line 61 “Any idea where do I go wrong?
Many thanks in advance,
Michal
- The topic ‘register_activation_hook error on oop plugin’ is closed to new replies.