• Resolved supergap

    (@supergap)


    Hi,

    I would like to insert the name of the subscriber, the plan name, the plan price and so on into a WP post or page. Something like: “hi -first name-, I want to inform you that your -subscription name- is going to be -subscription_status-…and so on

    I see that for ‘remind email’ it’s possible to insert some tags (look here below), but the same is not working if I try into a WP post:.

    Which are, please, the right shortcodes to get these data in a WP post or page?

    Thanks a lot!!!
    Giorgio.

    {{display_name}}
    {{subscription_name}}
    {{subscription_status}}
    {{subscription_start_date}}
    {{subscription_expiration_date}}
    {{subscription_price}}
    {{subscription_duration}}
    {{first_name}}
    {{last_name}}
    {{username}}
    {{user_email}}
    {{site_name}}
    {{site_url}}

    • This topic was modified 4 years, 1 month ago by supergap.
    • This topic was modified 4 years, 1 month ago by supergap.
    • This topic was modified 4 years, 1 month ago by supergap.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello @supergap,

    Thank you for reaching out to us.

    Regarding this, we do have a custom code that let’s you enable this shortcode:

    [pms-subscription-info key=”plan_name”]

    Take a look here to find our more on this:

    https://www.cozmoslabs.com/docs/paid-member-subscriptions/developer-knowledge-base/subscription-info-shortcode/

    You have to install that code as a custom plugin, after you can use the shortcode on any WP page you wish.

    How to install a custom plugin:

    1. Create your own empty custom plugin. Here is a link on how to do that.

    https://gist.github.com/sareiodata/76f701e01db6685829db

    2. Add the code in your plugin.

    3. Save your plugin and install it on your WP page as any other plugin.

    Now, you shall have the function you need. Let me know how that worked for you.

    Kind regards,

    Thread Starter supergap

    (@supergap)

    Hi, Thanks so much!!
    It works great. I add that to function.php of the theme.
    Using the same way, is it possible to get the username too?

    I tried adding:

    case ‘username’:
    return $subscription_plan->username;
    break;

    and then to call it in the post with [pms-subscription-info key=”username”]

    But it doesn’t work. And I think that the issue is about $subscription_plan that I have to change to something else..

    Thanks in advance.
    Regards

    Thread Starter supergap

    (@supergap)

    Hi,
    for the moment, adding a shortcode (that I found on o blog) in function.php I’m able to get name+surname, but not the username.

    If can be useful for someone, it is this:

    function show_loggedin_function( $atts ) {

    global $current_user, $user_login;
    get_currentuserinfo();
    add_filter(‘widget_text’, ‘do_shortcode’);
    if ($user_login)
    return ‘Welcome ‘ . $current_user->display_name . ‘!’;
    else
    return ‘Login‘;

    }
    add_shortcode( ‘show_loggedin_as’, ‘show_loggedin_function’ );

    Putting in the post: [show_loggedin_as]

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Shortcode to insert some PMS information into WP pages and articles’ is closed to new replies.