Classes not working in Functions!
-
Guys, what am I missing?
I am writing a plugin, that includes something like: class.php
In class:
class random_class {function unique_activate_function() {
error_log(“this worked”)
}}
my main file:
$object = new random_class;
$object->unique_activate_function(); //works perfect!
register_activation_hook(__FILE__, ‘activate_random_plugin’);
function activate_random_plugin() {
global $object
$object->unique_activate_function(); //FAILS
}
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Classes not working in Functions!’ is closed to new replies.