Title: change level from another php plugin code
Last modified: August 31, 2016

---

# change level from another php plugin code

 *  [anibalardid](https://wordpress.org/support/users/jackalpret/)
 * (@jackalpret)
 * [10 years ago](https://wordpress.org/support/topic/change-level-from-another-php-plugin-code/)
 * Hi, I have installed membership and i’m testing before buy.
    I have another plugin
   that do some things. So , with several conditions I want to change from my plugin
   the level membership of the user.
 * How can I do that ?
 * [https://wordpress.org/plugins/membership/](https://wordpress.org/plugins/membership/)

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

 *  Plugin Support [Amin – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support2/)
 * (@wpmudev-support2)
 * [10 years ago](https://wordpress.org/support/topic/change-level-from-another-php-plugin-code/#post-7376065)
 * Hello Anibal,
 * Here is example snippet code prepared by our developer – in this one membership
   is added to member basing on previous membership
    [https://gist.github.com/bappi-d-great/66db952e10028ed6f635](https://gist.github.com/bappi-d-great/66db952e10028ed6f635)
 * Part that will be interesting for you – adding membership to member is this
 *     ```
       $member = MS_Factory::load( 'MS_Model_Member', $user_id );
       	$subscription = $member->add_membership( $target_membership );
   
       	if ( $member->has_membership() ) {
       		$member->is_member = true;
       	} else {
       		$member->is_member = false;
       	}
       	$member->save();
       ```
   
 * `
 * Let me know if you still need any further assistance here
 * kind regards,
    Kasia
 *  Thread Starter [anibalardid](https://wordpress.org/support/users/jackalpret/)
 * (@jackalpret)
 * [10 years ago](https://wordpress.org/support/topic/change-level-from-another-php-plugin-code/#post-7376067)
 * from another plugin MS_Factory doesnt work …
 *  Plugin Support [Amin – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support2/)
 * (@wpmudev-support2)
 * [10 years ago](https://wordpress.org/support/topic/change-level-from-another-php-plugin-code/#post-7376110)
 * Hello Anibal,
 * Could you show me your whole code? If I can see it I might be tell more about
   why it is not working.
 * kind regards,
    Kasia

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

The topic ‘change level from another php plugin code’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/membership_b8cdaa.svg)
 * [Membership 2](https://wordpress.org/plugins/membership/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/membership/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/membership/)
 * [Active Topics](https://wordpress.org/support/plugin/membership/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/membership/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/membership/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Amin – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support2/)
 * Last activity: [10 years ago](https://wordpress.org/support/topic/change-level-from-another-php-plugin-code/#post-7376110)
 * Status: not resolved