I had this same problem. Even though this thread is eight months old, I figured I'd update it to help anyone who stumbles upon it so they don't have to figure it out for themselves like I did.
So, my guess is you had a plugin page, e.g. foo.php, in which you tried to do:
<?php
add_management_page('Test Manage', 'Test Manage', 8, 'testmanage', 'mt_manage_page');
// mt_manage_page() displays the page content for the Test Manage submenu
function mt_manage_page() {
echo "<h2>Test Manage</h2>";
}
?>
Which gives the error:
Fatal error: Call to undefined function add_management_page() in /Library/WebServer/htdocs/jsdalton.www.ere.net/wp-content/plugins/ere-live/ere-live.php on line 11
So what you have to do to make this work is wrap the add_management_page in a "callback" function, which is then attached to the add_action() function, as follows:
<?php
add_action('admin_menu', 'mt_add_pages');
function mt_add_pages(){
add_management_page('Test Manage', 'Test Manage', 8, 'testmanage', 'mt_manage_page');
}
// mt_manage_page() displays the page content for the Test Manage submenu
function mt_manage_page() {
echo "<h2>Test Manage</h2>";
}
?>
See how I just created a new function mt_add_pages() which I wrapped around the original call to add_management_page()? And then I just referenced that function in the add_action() call above.
I didn't spend any time looking at the internals, but I assume add_action grabs all the necessary include files etc. in order to allow your call to add_management_page() to work.
Anyhow, this should do the trick for you.