我正在尝试将菜单项添加到我的用户管理菜单。
这是我正在使用的代码:(我已经把它放在我的functions.php脚本中)
add_action('user_admin_menu', 'ang_profile_actions');
function ang_profile_actions() {
add_users_page( 'test menu', 'test menu', 'exists', 'test_menu', 'ang_parse_profile_menu');
}
但是,似乎“user_admin_menu”没有触发。我通过在函数 ang_profile_actions 中添加一个 exit() 来测试这一点,并且页面加载时不会停止。
这个设置对吗?我什至使用正确的钩子。有这么多,有时很难说清楚。
我只想在用户访问“wp-admin/profile.php”页面时在用户个人资料页面中添加菜单项。