What is a membership attribute and how do I use it?

I keep tripping over the membership attribute dialog. Searched everywhere and cannot get my head around it. How does it work? What is it for? Is there anywhere some detail as to how this is used and what it should produce? I would really appreciate a real life example as to how this is supposed to work. Thank you.

  • Sajid
    • DEV MAN’s Sidekick

    Hi @Pixeldrummer,

    Hope you are doing good today :slight_smile:

    It is used to store custom data for memberships. Take it like WordPress custom fields (in fact it is, its store in meta_tables like what WP do).

    Here is a real life example on how to use it. In this example I wrote a plugin to restrict how much a member can create blogs on WordPress multisite under one membership level.

    Hope that helps! Feel free to post a reply if you need further assistance :slight_smile:
    Cheers, Sajid

  • Pixeldrummer
    • Site Builder, Child of Zeus

    Ah, this may have some uses. So, would this work in the following scenario:
    A user is in the system but has a lapsed membership that lapsed 3 years ago or more.
    The user tries to renew the membership today but would now have to pay double.
    Could there be a filter written where a member who is trying to renew after three years has to contact the Society and cannot renew? I.e. compare the renewal date with the lapsed date somehow?

    If that were possible M2P would gain a notch or two of my respect.

  • Nastia
    • Support Rock Star

    Hello @Pixeldrummer, I trust you are doing well today!

    At the current time this is not possible achieve with Membership 2 plugin, out of the box, I’ll moved this over to the feature request area. More +1’s a feature request get more likely it would be considered for development.

    But it’s doable, if this is something that you require in close future, then please feel free to post a new job in our Jobs & Pros section on https://premium.wpmudev.org/wordpress-development/ so that a skilled developer can do that for you.

    Please, feel free to let us know if you require any further information!


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.