function addMenuItem($slug, $class) { $title = call_user_func(array($class, 'getTitle')); $a = add_submenu_page($this->slug, $title, $title, 'administrator', $slug, am4PluginsManager::createController($class)); if (method_exists($class, 'staticAction')) { add_action('load-' . $a, array($class, 'staticAction')); } }
function action_AdminInit() { // Setup filters to display post/page requirements; foreach (get_post_types() as $type => $o) { if (!class_exists($cname = "am4Protection_" . $type)) { $cname = "am4ProtectionFormController"; } add_meta_box('amember_sectionid', __("aMember Protection Settings", 'am4-plugin'), am4PluginsManager::createController($cname), $type, 'advanced', 'high'); add_filter("manage_edit-" . $type . "_columns", array($this, "addProtectColumn"), 10, 1); add_filter("manage_" . $type . "_posts_custom_column", array($this, 'addProtectionContent'), 10, 2); } }
function addMenuItem($slug, $class) { $title = call_user_func(array($class, 'getTitle')); add_submenu_page($this->slug, $title, $title, 'administrator', $slug, am4PluginsManager::createController($class)); }