ms_has_membership is bugged return nothing if we don't pass any ids


when we don't pass any parameter to the function ms_has_membership(), we don't have any return value. it works fine when we pass 0 as parameter. Or the ms_has_membership() function comment says that the parameter is optionnal, but it doesn't work without.

Best regards

  • Kasia Swiderska
    • Support nomad

    Hello Nematis,

    Can you show me how do you use this conditional tag? It should be used like this:

    if ( ms_has_membership() ) {
    echo 'user has any membership';
    } else {
    echo 'user don't have any memberships';

    Please note that this conditional tag don't check Guest Default memberships.

    Kind regards,

  • Nematis
    • New Recruit

    Hi Kasia,

    i used it like you say but it doesn't works and when i put it in a var_dump, i don't have any value returned.
    i should have to add 0 as parameter to get it working.

    if (ms_has_membership(0)){
            return friends_check_friendship($receiver_id, $sender_id) ? $button : '';
            return '';

    I know this tag don't check Guest and Default and this is what i want. I checked the ms_has_membership function code and i don't understand why the optionnal value isn't considered, it's seems to be func_get_args() who don't consider optionnal parameter value.

    Best regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.