Hello @wouthaksteen
I am experiencing some issues with the [wpuf-sub-info] shortcode
→ Firstly, please note the right shortcode is [wpuf_sub_info] and here is a output from my testing site/page after inserting- https://prnt.sc/1gpab7n. It should working fine.
Besides, you can look into these files/functions references to know how to get current_users subscription packs info.
/wp-content/plugins/wp-user-frontend/class/subscription.php shortcode >
wpuf_sub_info & wpuf_sub_pack.
function reference subscription_info() line 746 and subscription_packs() line 757
/wp-content/plugins/wp-user-frontend/includes/class-user-subscription.php function reference current_pack() line no 51-66
I hope this will helps.
Thanks.
Thanks for the help. I have tried looking into the code but I cannot seem to find a way to print the info using a PHP snippet. For example, if I would want to print the pack name from the php snippet, do you know how I should do that?
Something along the lines of
<?php
$current_user_id = get_current_user_id();
$sub_pack = wpuf_get_current_sub( $current_user_id );
echo $sub_pack;
?>
Hi again,
If you want to print Sub Info through PHP then you can use do_shortcode method like:
<?php
echo do_shortcode ('[wpuf_sub_info]');
?>
For further developer information, please reach our devs through our GitHub channel.
Thanks!
What I am trying to accomplish is something where I can customize what text to show the user. So I want to show them the following sentence:
‘You currently have X posts left.’
In PHP that would translate to
<?php
$posts_left = some_function();
echo "<p>You currently have {$posts_left} posts left.</p>";
?>
So essentially what I’m asking is; what php function do I need to get the amount of posts/products left as a variable in php?
Do you have any idea how this is possible? The shortcode just doesn’t work for me, even after disabling all plugins and custom css/php. It shows up on the top left, outside of the row and column I have put the code into. It is unusable at the moment.
See how it looks for yourself. https://prnt.sc/1iosmrt.
I would like to place it underneath the title ‘subscriptions’ but somehow the info is put at the top of my page.
Thanks in advance!