• Resolved Eugene

    (@euguk007)


    Hello Kuba,

    I am trying to figure out how to generate a new trigger for when the Admin manually approves a user with a specific user role. The user meta key that changes is ‘account_status’, from ‘awaiting_admin_review’ to ‘approved’.

    Looking at your Custom Trigger documentation, I just need a little hand to master it.

    Many thanks in advance!
    Eugene

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Kuba Mikita

    (@kubitomakita)

    Hi Eugene,

    the meta changed is a very tricky thing. You should hook into the profile_update action, but I’m not sure if you’ll be able to pull the old value at this stage to compare it.

    If you are using ACF, then their user updated hook allows for checking the values before and after saving.

    Definitely you should use the trigger postponing: https://docs.bracketspace.com/notification/developer/triggers/postponing so in the action() method you’d check the old meta and in the postponed_action() the new meta.

    Thread Starter Eugene

    (@euguk007)

    Thanks Kuba. I will delve into it 🙂

    Thread Starter Eugene

    (@euguk007)

    I am trying to make it work with Ultimate Member plugin, to send separate notifications to corresponding roles on Admin approval.

    Plugin Author Kuba Mikita

    (@kubitomakita)

    I don’t know UM plugin so good, so you’ll have to find the action hooks which fires before saving the value in the database and after. Or maybe they have a “transitional” hook which will allow you to do it without postponing

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Trigger on user meta key value change’ is closed to new replies.