• Resolved David Bee

    (@davidbawiec)


    Hi all!
    Have a small request/thought. When a subscription is created for a user, the give_subscriber user role is added to the user as well. However, this isn’t necessarily needed (or even wanted) in every setup. Can you please add a filter to allow devs to override whether the user role is going to be added to the user? All this would take would be to alter line 110 in wp-content/plugins/give-recurring/includes/give-recurring-subscriber.php from:

    if ( ! empty( $this->user_id ) ) {
    	$this->set_as_subscriber();
    }
    

    To:

    if ( ! empty( $this->user_id ) && apply_filters( 'give_set_user_as_subscriber', true, $this->user_id ) ) {
    	$this->set_as_subscriber();
    }
    

    A simple fix that would give devs the ability to set the parameter to false, thus bailing on the action.

    Let me know your thoughts!
    D

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘FR: Please add a filter for adding user role.’ is closed to new replies.