Problem with classes, functions and hooks
-
Hi,
I am currently developing some extensions for a theme and I got stuck on a problem:
I have a classclass myClass { function myFunction() { return "Anything"; } } $myClass = new myClass();
I also have a function which creates a tag for easier use inside the theme called the_extension :
function the_extension() { global $post; if($post->ID == '1') { add_action('init', array('myClass', 'myFunction')); } }
This doesn’t work… Where did I go wrong???
Thanx in advance
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Problem with classes, functions and hooks’ is closed to new replies.