according to this Callback example if I'm referencing a method inside a class, I should use add_filter by specifying an array with 2 elements, first the object then the method. Here is my code:
add_action ('login_head', array('Admin', 'plugin_setup'));
class Admin
{
public function plugin_setup()
{
add_filter('login_headerurl', array($this, 'the_logo_url'));
}
private function the_logo_url()
{
return get_bloginfo('url');
}
unfortunately my code does not seem to work unless I move the function the_logo_url()
outside the class. What's the best way of approaching this problem?
private
topublic
and makeplugin_setup()
static. – birgire May 5 '15 at 19:09PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, first array member is not a valid class name or object
– Tetravalente May 5 '15 at 19:14