Custom user roles

To add a role see: https://codex.wordpress.org/Function_Reference/add_role To add capabilities see: click add_cap link on the bottom A list of all caps see: https://codex.wordpress.org/Roles_and_Capabilities For all the roles you can also use them for different post types. if post type is “books” edit_pages -> edit_books. N.B.: This setting is saved to the database (in table wp_options, … Read more

How can I remove these options from the dashboard?

You can use the remove_menu_page function from the admin_menu action. An example for you would be to add this to your functions file (this will remove those menu links for you as well). function remove_menus() { remove_menu_page( ‘options-general.php’ ); remove_menu_page( ‘profile.php’ ); } add_action( ‘admin_menu’, ‘remove_menus’ ); If you need to be more specific to … Read more

Empty Dashboard in WordPress

I know this post is old but the right answer may help someone else. Sounds like you are still using WordPress 3.* because it has a bug causing the issue. You need to be sure you’re using the right version of Apache and PHP as required by the copy of WordPress version you just upgraded … Read more

Removing Admin Bar Node Based on Role

WP_User has a roles array. Get the current user with wp_get_current_user() and check if your role is in the array. add_action( ‘admin_bar_menu’, ‘remove_new_content_menu’, PHP_INT_MAX ); function remove_new_content_menu( $wp_admin_bar ) { // get the current user $user = wp_get_current_user(); // define roles that cannot see the `new content` button $blacklisted_roles = array(‘grocery’, ‘subscriber’); // remove the … Read more

WordPress4.1.15 Dashboard links not working

It could be that your upgrade hasn’t worked properly. Does it still think you have an upgrade to 4.7.2 waiting? Personally I would download a fresh copy of 4.7.2 and re-upload this to be sure nothing is broken or missing. Make sure to take a backup of your database and files should anything bad happen. … Read more

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