Template Tags for Membership Plugin

Is there documentation of how to user PHP code instead of Short codes to hide content. I really want to code the limitations into the template and not rely on Short Codes in the content area. We are going to be hiding and showing META data and other functions.

  • Elliott Bristow
    • The Bug Hunter

    Hi @tayloegray,

    You can still use the shortcodes in the PHP files, you just have to wrap them in a do_shortcode function.

    For example:

    <?php do_shortcode('[not-level-member]Non-members can't see this[/not-level-member]') ?>

    Is that the kind of thing you were looking for?+

  • tayloegray
    • Design Lord, Child of Thor

    I do not think that would do what I want,

    What I want to do is the followin

    <? if not-level-member() {

    echo "NOT A MEMBER" ;

    } ?>

    In a template tag, or something like. I guess I can do what you suggesting, but I can not, for example do the following

    <? if not-level-member() {

    include(something.php) ;

    } ?>

  • Elliott Bristow
    • The Bug Hunter

    Ok in that case you are probably looking for the following commands:

    current_user_is_member()
    current_user_has_subscription()
    current_user_on_level($level_id)
    current_user_on_subscription($sub_id)

    They should give you the boolean responses you're looking for.

    Give it a go and let me know how you get on!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.