allow editors to edit menus?

add this to your theme’s functions.php: // add editor the privilege to edit theme // get the the role object $role_object = get_role( ‘editor’ ); // add $cap capability to this role object $role_object->add_cap( ‘edit_theme_options’ ); Update (suggested in comments): You probably shouldn’t do this on every request, AFAIK this causes a db write. Better … Read more

How to check if a user is in a specific role?

If you only need this for current user current_user_can() accepts both roles and capabilities. UPDATE: Passing a role name to current_user_can() is no longer guaranteed to work correctly (see #22624). Instead, you may wish to check user role: $user = wp_get_current_user(); if ( in_array( ‘author’, (array) $user->roles ) ) { //The user has the “author” … Read more

If the current user is an administrator or editor

First answer, not WordPress-related because it is just only PHP: Use the logic “OR” operator: <?php if( current_user_can(‘editor’) || current_user_can(‘administrator’) ) { ?> // Stuff here for administrators or editors <?php } ?> If you want to check more than two roles, you can check if the roles of the current user is inside an … Read more

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