Basically, I’m in the process of making a little plugin for my WordPress site, I’m encountering the most annoying problem I can find, My current structure is like such
/wp-content/plugins/videos/videos.php
The content inside the PHP file is as follows :
if(!class_exists('WP_GraceMedia_Videos')) {
class WP_GraceMedia_Videos {
public function __construct() {
add_action('admin_menu', array(&$this, 'add_menu_page'));
}
public function add_menu_page() {
$page_title = "GraceMedia Video Management";
$menu_title = "GraceMedia Videos";
$capability = "edit_options";
$menu_slug = "videos/videos-admin.php";
$function = "";
$icon_url = plugins_url('videos/images/icon.png');
$position = "6";
add_menu_page($page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position);
}
public static function deactivate() {
}
public static function activate() {
}
}
register_activation_hook(__FILE__, array('WP_GraceMedia_Videos', 'activate'));
register_activation_hook(__FILE__, array('WP_GraceMedia_Videos', 'deactivate'));
}
It all appears to be correctly formatted to me, It’s actually activating the plugin and letting me de-activate it, It’s just not adding the item to the WP Admin Menu
The capability “edit_options” you have in your
add_menu_page
code does not exist according to the WP Codex. Try changing it to something like “edit_theme_options”.use the ‘manage_options’ instead of ‘edit_options’.