• Hello everyone!

    I’m currently trying to set up the automatic registration when a user is created with a Zapier Webhook. With this webhook, I change the role to a custom one, as well as sending an action for WordPress to perform after the user has been created.

    I tried the following code:

    
    function custom_role_meta_fn($user_id) {
        $user_meta= get_userdata($user_id); 
        $user_roles=$user_meta->roles; 
        if (in_array('subscriber_custom', $user_roles)){
           update_user_meta( $user_id, 'simple-restrict-slug', 'yes');
        }
    } add_action('custom_role_meta', 'custom_role_meta_fn');

    Unfortunately, it’s not updating the permission in the user profile. Could you help? Thank you in advance!

    • This topic was modified 6 years, 8 months ago by aehernandez.
Viewing 1 replies (of 1 total)
  • Plugin Contributor Awaken Solutions Inc.

    (@awakensolutions)

    Is your code able to add any user meta to the user?

    If so, then it should definitely be showing up as a permission for the user (assuming you typed the user permission slug correctly, note that the slugs are prefixed).

    If not, the issue of writing user meta needs to be fixed and then try again, because that is unrelated to this plugin.

Viewing 1 replies (of 1 total)

The topic ‘Update restriction status with Webhooks’ is closed to new replies.