How can I add the User Menu for Authors (role)?

How do I make this (and the pages) appear for authors, now that they actually have the relevant capabilities? They don’t have the needed capabilities, just because a role can add/edit/remove users does not mean they can list_users. Similarly there are other capabilities such as role promotion etc, here’s the code for administrators, e.g. this … Read more

Why is user_can_access_admin_page() an undefined function?

As mentioned by Jacob Peattie: functions not loaded yet. You will need to use hooks/actions (init, wp etc) https://codex.wordpress.org/Plugin_API/Action_Reference e.g. function callMyMethod(){ $userLoggedIn = is_user_logged_in(); echo ‘INIT Action: User Logged in: ‘.var_export($userLoggedIn, true); if ( is_admin() ) { $canAccess = user_can_access_admin_page(); } } add_action(‘init’,’callMyMethod’); This answer is assuming you’re creating a plugin and calling the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)