2012-05-29 28 views
2

我想将窗体挂接到外部函数上。钩子由名字载入我的形式:

add_action(media_uploader, 'the_hook'); 
function the hook(){ 
//..... 
return wp_iframe('media_upload_potato_form', $errors); 
} 
function media_upload_potato_form(){ }// my form 

如果我使用上述功能中的一类,如下显示,它得到的错误:

return wp_iframe($this->media_upload_potato_form, $errors); 

我怎么可以连接是否正确?

回答

2

使用

return wp_iframe(array('YourClassName', 'media_upload_potato_form'), $errors); 
+2

这应该只是工作,它的功能是静态的;数组($对象,'method_name')应该适用于非静态。 –

+0

完美,它的作品! – Jenny

相关问题