I’m facing a problem while creating a submenu under my settings menu n wordpress admin panel. I have done everything correctly and also I have the way to gt around this problem. But what i really want to know that why is the problem appearing.
add_action('admin_menu', 'options_page');
function options_page() {
add_submenu_page(
'options-general.php',
'Options page',
'Options page',
'manage_options',
'my-option-page',
'option_config');
}
this works great and there is no problem with it. But when i tried to change ‘my-option-page’ to ‘__FILE__‘ it stops working saying that I don’t have enough permission. I have this tutorial at http://www.sitepoint.com/wordpress-options-panel/
But it’s not working. Any ideas?
Mark Jaquith, a lead WordPress developer, tweeted in 2009 that “If you use FILE in add_submenu_page() or add_*_page() function calls in WordPress plugins, you’re doing it wrong. Use a unique string.”
Is FILE already used for a menu or submenu? That could be one cause; although of course I’d remove the use of FILE anyway.
Another cause could be that the first argument, “parent slug”, doesn’t exist as a menu page. or if it does, it exists under a different name.