Support Forum
Hi -
I'm using MemberPress with my site, and I have multiple course products that a user can purchase. I am running into trouble because SimplePress is not picking up the "add_role" action that we are using to add multiple roles for a user. I've read the other post that recently had a similar issue, and I used the Event Logger to confirm that SimplePress doesn't appear to catch the "add_role" action.
Is it possible to address this? Otherwise, my students are not going to have access to their course forums.
Thanks!
Samantha
not sure what you mean by the 'add_role' action... wp does not have such an action...
when wp changes the role of a user, it fires the 'set_user_role' action... This is to let themes and plugins know that a user's role has changed... if a role is being changed in a non standard manner, then plugins wont know about it..
if you are changing the role independently of the wp api, you could fire the same action and things should work... the action should be fired (as wp does) with three arguments... the first is the user id (integer), the second is the new role (string) and the third argument is the old roles (array)...
of course, its possible there is an implementation of wp role changing that has changed in wp or a path we are not aware of, but the role changing seems to be working for users...
Visit Cruise Talk Central and Mr Papa's World
I can find no mention of an 'add_user_role' action hook in the WordPress core code. We have, sadly, come across a few plugins over the years that replace a part of core functionality but do not implement the standard hooks. Actually, I believe we were guilty of this on at least one occasion many years ago!
Please do let us know what the membership people come back with. If they can provide a custom hook that IS available that passes the same data then we can probably help you implement that
YELLOW
SWORDFISH
|
I only know of the action I mentioned previously... where are you getting these actions from? docs? or hooks that your membership plugin is firing?
Visit Cruise Talk Central and Mr Papa's World
Hi -
The MemberPress guys came back and said the add_role is a supported action/problem-with-post-edit-buttonook in the WordPress codex. Here's a link:
http://codex.wordpress.org/Cla.....24role_.29
Is there any way to get support for this action into SimplePress? It would allow my new users to once again have their Forum access set automatically, instead of me having to go in and update it for each new user.
Thanks!
Samantha
In case you prefer the Code Reference, I also found it there:
https://developer.wordpress.or...../add_role/
Thx!
'add_role' is a core function NOT an action hook. No plugins can extract any information from a function such as this.
I was also under the impression that it was your users that we needed to know about which is not the same thing as a role.
As Mr Papa said above - the standard WordPress action hook for adding a user to a role is the 'set_user_role’ action…
YELLOW
SWORDFISH
|
Hi again,
I'm setting Forum permissions based on user roles, and some users may have multiple roles. For existing users, MemberPress is using "add_role" to add the additional roles for each user.
They are telling me the exact opposite of what you're saying - they tell me that lots of plug-ins catch the add_role and are able to use that to set up additional info.
I'll go back to them again with your comments above, and see what they say.
Thanks!
1 Guest(s)