根据这个Callback example 如果我在类中引用一个方法,我应该使用add\\u filter,通过指定一个包含2个元素的数组,首先是对象,然后是方法。这是我的代码:
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\');
}
不幸的是,除非移动函数,否则我的代码似乎无法工作the_logo_url()
课外活动。解决这个问题的最佳方法是什么?