• Dear Support,

    I am just considering whether to buy this plugin or not – I do have a trial for testing purpose (WP 5.4 + default template twenty twenty).

    I found that the restricted shortcode does not work in template.

    PHP file looks like this:

    <?php
    get_header();
    echo do_shortcode(“[restricted level=’1′]”);
    ?>
    <div class=”section”>
    <?php
    echo get_post_field(‘post_content’, $page->ID);
    ?>
    </div>
    <?php
    echo do_shortcode(“[/restricted]”);
    get_footer(); ?>

    And front-end shows the error message, but still shows the content and shows also the [/restricted] tag. It is in code like this:

    <div class=”ewd-feup-error”>Sorry, your account isn’t the correct level to access this content.</div>
    <div class=”section”>Content text visible</div>
    ” [/restricted] “

    Can you please assist?

    Thank you

    • This topic was modified 4 years, 7 months ago by aladyreg.
    • This topic was modified 4 years, 7 months ago by aladyreg.
    • This topic was modified 4 years, 7 months ago by aladyreg.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support jaysupport

    (@jaysupport)

    Hello aladyreg,

    I can confirm that this solution (using the do_shortcode method) has definitely worked for others. That being said, it can depend on the way that your theme is coded.

    I did notice that your single quotes in the level attribute are not the same. Could you make sure that both single quotes are the same ( ‘ ) and see if that makes a difference?

    Also, please note that the www.remarpro.com forums are meant for questions about the free version of this software. As such, if you have any questions specifically about the premium version, please contact us directly by email or visit our website and we’d be happy to assist you with that.

    Thread Starter aladyreg

    (@aladyreg)

    Dear Jay,
    Thank you for your reply.
    I tried almost all possible type of quotes, they are same (it was wrongly formated here).

    The template is the default one Twenty Twenty available in WordPress 5.4.1. I have tested also other inbuild template Twenty Nineteen, but the same issue – those are the default template delivered with WordPress installation. There is just this module for a test purpose, so there should be no conflict etc..

    get_header();
    echo do_shortcode(“[restricted level=’1′]”);
    ?>
    <div class=”section”>
    <div class=”container”>
    <div class=”row items”>
    <div class=”col-12 item content”>
    AA
    <?php
    echo get_post_field(‘post_content’, $page->ID);
    ?>
    </div>

    </div>
    </div>
    </div>

    <?php
    echo do_shortcode(“[/restricted]”);
    get_footer(); ?>

    Visible text>

    AA
    Lorem ipsum..!

    [/restricted]

    Plugin Support jaysupport

    (@jaysupport)

    The single quote before the 1 in your first shortcode is still off. It’s different than the quote after the 1. Shortcodes will not work unless plain text quotes are used. If you wanted, you could try reversing your use of the quotes, to use singles for the do_shortcode and doubles in our shortcode. For example:

    echo do_shortcode('[restricted level="1"]');

    You could also try without the level parameter, just to see if it is indeed the quote causing the issue. So:

    echo do_shortcode('[restricted');

    Beyond that, there isn’t anything else in the plugin that could be affecting it. If you think maybe there’s a conflict with another plugin, you could try deactivating them all, except ours, to see if it makes a difference, and then reactivate them one by one to isolate the source of the conflict.

    Thread Starter aladyreg

    (@aladyreg)

    You really can not provide a support on this as you do not read what I replied! I am really disappointed, I was happy about the solution, but support is second part of the product and that fails…

    Again, in points:
    1) Wrong quote is caused by WYSIWYG editor of this www.remarpro.com forum textarea, not me or my code!
    2) You do not reply to not accepting ending tag [/restricted]
    3) No other plugins installed

    So again, please read carefully!

    Code:

    <?php
    get_header();
    echo do_shortcode(“[restricted]”);
    ?>
    <div class=”col-12″>
    Test Text
    </div>
    <?php
    echo do_shortcode(“[/restricted]”);
    get_footer(); ?>

    And in html code is generated:


    You must be logged in to access this page.”
    <div class=”col-12″>
    Test Text
    </div>

    [/restricted] ”

    In visual:

    You must be logged in to access this page.
    Test Text
    [/restricted]

    So:
    1) First shortcode is accepted, but only affects the one line
    2) Other elements (div, p, any text, etc..) is still displayed
    3) Second ending shortcode is most likely not accepted as it displays [/restricted] in the code

    Can you assist? It happens on:
    1) already 2 new WP installations (without any plugin!)
    2) in all three inbuild WP themes

    • This reply was modified 4 years, 6 months ago by aladyreg.
    Thread Starter aladyreg

    (@aladyreg)

    No reply? Really amazing, better not to purchase it!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Restricted does not work’ is closed to new replies.