public function saveUserPofile($user_id)
    {
        //Authentication check
        if (!is_super_admin()) {
            return;
        }

        if (!is_network_admin()) {
            return;
        }

        if (isset($_POST['userEnabled']) && is_array($_POST['userEnabled']) && !empty($_POST['userEnabled'])) {
            foreach ((array) $_POST['userEnabled'] as $site_key => $role) {
                if (get_role($role) !== null) {
                    if ($site_key != 1) {
                        update_user_meta($user_id, $this->db->prefix . $site_key . '_capabilities', array($role => true));
                    } else {
                        update_user_meta($user_id, $this->db->prefix . 'capabilities', array($role => true));
                    }
                } else {
                    if ($site_key != 1) {
                        delete_user_meta($user_id, $this->db->prefix . $site_key . '_capabilities');
                    } else {
                        delete_user_meta($user_id, $this->db->prefix . 'capabilities');
                    }
                }
            }
        }
    }
public function saveUserPofile($user_id)
    {
        //Authentication check
        if (!is_super_admin()) {
            return;
        }

        if (!is_network_admin()) {
            return;
        }

        if (isset($_POST['userEnabled']) && is_array($_POST['userEnabled']) && !empty($_POST['userEnabled'])) {
            foreach ((array) $_POST['userEnabled'] as $site_key => $role) {
                if (get_role($role) !== null) {
                    if ($site_key != 1) {
                        update_user_meta($user_id, $this->db->prefix . $site_key . '_capabilities', array($role => true));
                    } else {
                        update_user_meta($user_id, $this->db->prefix . 'capabilities', array($role => true));
                    }
                } else {
                    if ($site_key != 1) {
                        delete_user_meta($user_id, $this->db->prefix . $site_key . '_capabilities');
                    } else {
                        delete_user_meta($user_id, $this->db->prefix . 'capabilities');
                    }
                }
            }
        }
    }
public function saveUserPofile ( $ user_id ) { //Authentication check if ( ! is_super_admin ( ) ) { return ; } if ( ! is_network_admin ( ) ) { return ; } if ( isset ( $ _POST [ 'userEnabled' ] ) && is_array ( $ _POST [ 'userEnabled' ] ) && ! empty ( $ _POST [ 'userEnabled' ] ) ) { foreach ( ( array ) $ _POST [ 'userEnabled' ] as $ site_key => $ role ) { if ( get_role ( $ role ) !== null ) { if ( $ site_key != 1 ) { update_user_meta ( $ user_id , $ this -> db -> prefix . $ site_key . '_capabilities' , array ( $ role => true ) ) ; } else { update_user_meta ( $ user_id , $ this -> db -> prefix . 'capabilities' , array ( $ role => true ) ) ; } } else { if ( $ site_key != 1 ) { delete_user_meta ( $ user_id , $ this -> db -> prefix . $ site_key . '_capabilities' ) ; } else { delete_user_meta ( $ user_id , $ this -> db -> prefix . 'capabilities' ) ; } } } } }
Handle save data
@return void
Handle save data