I have this class I created on a theme within a Wordpress environment.
class Theme {
function __construct()
{
add_action('after_setup_theme', array(&$this, 'do_this'));
}
function do_this()
{
require_once('helper_functions.php');
}
}
$theme = new Theme();
And within the helper_functions.php I have:
function get_image()
{
return 'working';
}
But now I am puzzled because when I execute this
echo $theme->get_image();
It doesn't work....But if I called it directly it works like this:
echo get_image();
But I thought since I am using a class method, I need to use the class object to get to a class method...Why am I able to call it directly?