Support » Plugin: amr users » First Role Order

  • Resolved peter8rossi

    (@peter8rossi)


    The yearly membership for our archery club just updated and now the BB Press “Participant” is showing instead of the WordPress roles of “Member” etc, (actually S2M role). How do I get the WordPress role to be first role and not the forum role as first role?

    There is just a “role” in wordpress users, but I can not find it in the amr users field to display in our member’s directory.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author anmari

    (@anmari)

    Hi peter,

    a bbpress role is essentially still a wp role, a custom wp role. Using a plugin you can assign it wordpress capabilties. WordPress itself doesn’t care about the order.

    A better solution might be to use the ‘roles’ field, not the ‘first role’. ‘Roles’ will show all the roles that a user has and you can then include or exclude by those ‘roles’.

    The ‘first role’ is a dummy field created by the plugin and is literally what the db has as the first element in the capabilities usermeta.

    It is there for historical compatibility. Somehow in your wp setup the person probably was assigned a bb press role before being assigned a wp role. If you really do want to use the first role you could try via phpmyadmin copying the usermeta array value for a similar user who has the wp role first then pasting that into the user who didnt get a wp role assigned. Do this carefully, make sure you have a backup.
    For the future you then need to ensure that the way you have setup your plugins or converted your users, they will have one of the subset of roles that you regard as ‘wp’ as the fso called ‘first role’.

    In my opinion, it would be better to not rely on the order the roles are stpred in the db and set up the role definitions in a way that suits your functionality and reporting requirements.

    Thank you for your detailed answer. My first thought was to use the “Roles” field, but it does not show in the database and does not come up when I use “find new fields” Does it have a different technical name (using s2members)?

    Plugin Author anmari

    (@anmari)

    Hi Peter,

    In the database it is in the usermeta table with meta_key yourprefix_capabilities. Because everyone calls it roles, this plugin calls it ‘roles’. Arguably wordpress should have called it wp_roles 😉
    This plugin will also list each role separately as a field using yourprefix_capabilities-rolename eg: wp_capabilities-author

    EG:

    
    wp_capabilities 	a:2:{s:13:"administrator";b:1;s:13:"bbp_keymaster"...

    SO
    1) check in your …/wp-admin/admin.php?page=ameta-admin-meta-keys.php that you have NOT excluded “yourprefix_capabilities” DO exclude any unneeded meta keys to simplify the next screen. Click Update.

    2) THEN go to …wp-admin/admin.php?page=ameta-admin-nice-names.php and click ‘find new fields’ then scroll down. You should find both ‘roles’ (a list of all roles assigned to each user) and ‘fields’ for each role that each existing user has.

    /wp-admin/admin.php?page=ameta-admin-meta-keys.php shows “wp_capabilities” and wp-admin/admin.php?page=ameta-admin-nice-names.php shows the list of all roles, but there is no wp_capabilities. I only want 1 column not the 4 that I would need to show club membership level. I was hoping to use the wp_capabilities along with an exclusion for bbPress roles to have only one column as I had with the first_role, before I updated this years membership.

    I however have found a work around. I select members in WP user and then change everyone to spectator for bbPress, update and then change everyone back to participant. This looks puts the memberships back in “first place”.

    Thank you for your help.

    Plugin Author anmari

    (@anmari)

    Hi Peter,

    The array field is also listed under “nicenames” by the plugin. As mentioned above the plugin calls it ‘roles’. It will list all the roles that a user has as found in the wp_capabilities usermeta record.

    Plugin Author anmari

    (@anmari)

    Hi Peter, I neglected to mention (in case anyone does not have the addon) that the ‘roles’ field is added back in as field by amr-users-plus, since the default generic logic in amr-users takes that usermeta array down to the individual elements (roles) in wp_capabilties, creating a field for each one.

    IE: to see and use the roles as a list of roles, one needs to activate amr-users-plus.

    Hi Anmari,

    Thank you. My work around is working, but I really should buy the addon which will also give me the EOT field as a date.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘First Role Order’ is closed to new replies.