• in the function _mw_adminimize_set_menu_option()

    I’ve replaced

    // set admin-menu
    foreach ($user_roles as $role) {

    if($role == $role[0]){
    if ( current_user_can($role) ) {
    $mw_adminimize_menu = $disabled_menu_[$role];
    $mw_adminimize_submenu = $disabled_submenu_[$role];
    }
    } elseif ( current_user_can($role) ) {
    $mw_adminimize_menu = $disabled_menu_[$role];
    $mw_adminimize_submenu = $disabled_submenu_[$role];
    }
    }

    by

    // set admin-menu
    foreach ($user_roles as $role) {
    $user = wp_get_current_user();
    if(in_array($role,$user->roles)){
    if ( current_user_can($role) ) {
    $mw_adminimize_menu = $disabled_menu_[$role];
    $mw_adminimize_submenu = $disabled_submenu_[$role];
    }
    }
    }

    As you can see my version checks if the current user has that role assigned to them before assigning it. The old code would always return true for Current user can when logged in as a site admin, therefore random permissions would be applied based on the order of the array.

    thank you for the great plugin

    https://www.ads-software.com/extend/plugins/adminimize/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Greetings!
    It’s almost as if you were reading my mind- yesterday I left a message in the author’s official site to report this problem with WordPress MU.

    I’m glad you posted this solution, it works nicely. However, there’s still problems with the rest of the sections, for instance, the Write Post template. If I deactivate an option for the Authors (for instance), the Admin account(s) are affected as well. Not sure why is this happening and I can’t quite see how to edit the plugin to fix this, specially considering it’s related to WordPress MU and not the regular WordPress distribution. Any help would be appreciated.

    Yes, it’s super. Autor: can, you fix it ?

    Many thanks for this entry, i will include this on the next fix. Current i will write an new verison, all new code only for the important tasks of the plugin; is is to heavy and have so muc different options for different wp-version. I think i write at first a fix and afterthis a new verison.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘adminimize small bug / with my fix for wordpress MU’ is closed to new replies.