Hooking into user_admin_menu fails to add menu.
-
I’m trying to create a custom menu visible to multisite users without a blog. I already have a working minimal test, which I can display to users with a blog:
add_action('admin_menu', 'test_user_admin_menu'); function test_user_admin_menu() { add_menu_page('Test Menu', 'Test Menu', null, 'test', 'test_user_admin_page'); } function test_user_admin_page() { echo "<h2>Hello world</h2>"; }
Based on codex, to make this menu appear to network users without a blog I need to hook into
user_admin_menu
action. I verified that I’m using the right hook by changing the first line of the above code to:add_action('user_admin_menu', 'test_user_admin_page');
This does produce “Hello world” heading on loading dashboard for such user. However, changing the line to:
add_action('user_admin_menu', 'test_user_admin_menu');
produces no menu or output of any kind….
Where am I going wrong? Could somebody please give me a clue?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Hooking into user_admin_menu fails to add menu.’ is closed to new replies.