# Update membership level with pmpro and wp-discourse

**URL:** <https://meta.discourse.org/t/update-membership-level-with-pmpro-and-wp-discourse/150583>\
**Category:** WordPress\
**Created:** [May 6, 2020, 11:56am UTC](https://meta.discourse.org/t/update-membership-level-with-pmpro-and-wp-discourse/150583 "2020-05-06T11:56:25Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [May 6, 2020, 3:23pm UTC](https://meta.discourse.org/t/update-membership-level-with-pmpro-and-wp-discourse/150583/2 "2020-05-06T15:23:39Z")

</div>

You’ll need to add an action to your `functions.php`

```plaintext
/* see example at http://hookr.io/actions/pmpro_after_change_membership_level/ */
do_action( 'pmpro_after_change_membership_level', $level_id, $user_id, $cancel_level );
function action_pmpro_after_change_membership_level( $level_id, $user_id, $cancel_level ) {

 . . . . stuff that gets the membership level and group and adds them to the group

}
```

---

_[View the full topic](https://meta.discourse.org/t/update-membership-level-with-pmpro-and-wp-discourse/150583)._
