Make the Upgrade paths to deny initially

When you create a new membership in Membership 2 Pro. It automatically allows all existing memberships in the upgrade path. It will be helpful if it is turned off for all initially and I could choose the one I will allow.

  • Adam Czajczyk
    • Support Gorilla

    Hello Ingenieurbüro Dr. Plesnik GmbH

    I hope you're having a good day today!

    The "upgrade paths" currently are all set to "allowed" by default and there's no "out of the box" way to change it. I also didn't found any "direct" way to change this default options with some additional code, I'm afraid, other than "hacking" the plugin code directly.

    However, I found some filter in the plugin that I hope may be of help but I need to consult that with our developers. I've passed the question to them and am awaiting their response so please keep an eye on this ticket and we'll update you here as soon as we get to know more on this.

    Kind regards,

  • Panos
    • SLS

    Hi Ingenieurbüro Dr. Plesnik GmbH ,

    Not sure if a button that would set the Upgrade Paths for all memberships would help. If you are interested, you can try out this mu-plugin :

    After download, unzip it and upload the ms-deny-membership-upgrade.php file to the wp-content/mu-plugins folder. If that folder doesn't exist you can simply create it.

    After the upload, you should see a new link/button with text Deny Upgrades at the footer of the Membership Settings page

    After clicking that, it should try and set all Upgrade Paths for all Memberships to deny.

    If you want to exclude some membership_ids, you can add the ids in array in line 70, for example change it from
    $excluded_membership_ids = apply_filters( 'WPMUDEV_MS_Deny_Upgrade/excluded_membership_ids', array() );
    to :
    $excluded_membership_ids = apply_filters( 'WPMUDEV_MS_Deny_Upgrade/excluded_membership_ids', array( 256, 786, 954 ) );
    to exclude memberships with ids 256, 786 and 954.

    I would strongly suggest to test this first in a staging site.

    After you are done, you can delete that file.

    Kind regards!

  • Ingenieurbüro Dr. Plesnik GmbH
    • Site Builder, Child of Zeus

    Hi there,

    thanks for this option but it really is of no use once you have a few MS you are then typing ids for hours. What now is clicking for hours is then typing ids? Really no help.

    The idea would be great if you could switch this button upon creation of a new membership for this particular membership and speaking form a php-coding perspective is really not a difficult job. So could that be a good addition for the next update?

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.