5
将参数传递给管理菜单页面回调?
情况:我正在开发一个插件,并且正在将其作为一个类进行开发,一切正常,直到遇到这种情况。我想把事情弄干净一点,然后尝试一下。 class MyPlugin { function __construct() { add_action('admin_menu', array(&$this, 'myplugin_create_menus'); } //I don't want to write a function for every options page I create //so I prefer to just load the content from an external file. function load_view($filename) { $view = require(dirname(__FILE__).'/views/'.$filename.'.php'); return $view; } //Here is where the problem …