• Hi Michael,

    This plugin is great!.
    As I am getting to much approvals to be done manually (more than 200 per week), I would like to do it thru code as my members are validated after terminating a WooCommerce order and feeding a form (wsform plugin).
    I would like to either accept or reject either by code either using a CSV file or hooking a woocommerce function.
    Could you please let me know which function I could call to either accept or reject a member?

    Many thanks again for this plugin.

    Regards

    Jose

Viewing 6 replies - 1 through 6 (of 6 total)
  • Michael Beckwith

    (@tw2113)

    The BenchPresser

    You could use https://github.com/WebDevStudios/BuddyPress-Registration-Options/blob/master/includes/core.php#L531-L549 and pass in the user ID and string true or false and update their current status. Do note that it expects the users to already be existing in the database as we set the original status on the user_register hook.

    Thread Starter PICHI1966

    (@josett225)

    Hi Michael

    Many thanks for answering so fast as usual. I will try in the following days and update you.

    Regards

    Jose

    • This reply was modified 3 years, 5 months ago by PICHI1966.
    Thread Starter PICHI1966

    (@josett225)

    Hi Michael

    Quick update and small question
    I have been able to change by code and also using AdminColumn plugin to display (and edit) your user custom field _bprwg_is_moderated. This is giving me a full view of all my users.

    In the meantime, I would like to avoid in some case to delete the user account when rejecting the Membership. The user could continue to be a customer instead of being a member.
    I believe there 3 status possible :
    1.Reject member means user is deleted
    2.Keep Customer means user keeps the actual status (the one you put the user until accepted or rejected) (_bprwg_is_moderated = true)
    3.Accept member means user is becoming a member. (_bprwg_is_moderated = false)

    Any way to do that?

    Best Regards

    Jose

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    I would need to do some restructuring to handle some details here. Technically, they should be able to use the site in general, even when flagged as moderated, like if you have an eccommerce section or a standard blog area. We only limit access to the BuddyPress and bbPress areas. We’ve never prevented access to EVERYTHING.

    However, if you’d not want those specific people listed as pending moderation, that’s a detail I’d need to do some amending for.

    Thread Starter PICHI1966

    (@josett225)

    Hi Michael,

    Many thanks for answering. You are right without doing nothing, they get limited in BP and BB by default and I like this type of moderation.
    The reject action is deleting the user. I would like to keep them if they book an event or if they did an order. Is there any hook function to change the behavior of the reject?
    Reading your last comment, I think adding a third keep moderated action could keep them as user (not member) but could be deleted from the user registration list to be handle.

    Do you think it could make sense to add a search feature as in my case I have 32 pages to handle? or a link to the user request as today we are sent to the first page of the user list page from the email received?

    Best Regards

    Jose

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Is there any hook function to change the behavior of the reject?
    Not at the moment, part of how I’d need to revise and add behavior for. The listing in the moderation tables is mostly just based on that user meta key, and that user meta is how we determine if they should see things. So, it kind of feels like we just need a way to prevent display in the moderation list, while keeping the rest of behavior.

    Your last two questions are also things we’d need to revise things on and come up with possible solutions for. It’s not a super robust plugin admittedly, and as you can see.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to approve/reject by code?’ is closed to new replies.