lundi 23 mars 2015

Editor Widget Role


i need to give to editor role the access on widget (or if possibile on a specific widget).


I use the code on this question and function but i have a problem. The editor can see the widget and also the "theme options" / "background" / "custom" of theme. I try to edit the code with this but nothing change:



// Editor accesso negato file template

function custom_admin_menu() {

$user = new WP_User(get_current_user_id());
if (!empty( $user->roles) && is_array($user->roles)) {
foreach ($user->roles as $role)
$role = $role;
}

if($role == "editor") {
remove_submenu_page( 'themes.php', 'themes.php' );
remove_submenu_page( 'themes.php', 'nav-menus.php' );
remove_submenu_page( 'themes.php', 'customize.php' );
remove_submenu_page( 'themes.php', 'options-framework.php' );

}
}

add_action('admin_menu', 'custom_admin_menu');




Aucun commentaire:

Enregistrer un commentaire