Inserting a Shortcode into the Review area

This topic contains 1 reply, has 2 voices, and was last updated by  Alex Rollin 6 years, 6 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #428870

    James Grove
    Expired Member
    Post count: 30

    Hello GeoDirectory –

    I’m using Memberpress on my website, to control what content users can see.

    I only want “Resident” users (as opposed to non-residents or guests) to be able to leave reviews, or to be able to read the reviews that are posted.

    To do that, I need to be able to insert a custom shortcode into the Geodirectory review area. I want all users to be able to see the businesses, but only residents to see the reviews.

    The codes look like this:

    Shortcode MEPR-SHOW:
    [mepr-show if=”rule: 32171″] This content is shown only to authorized members. It is hidden from everyone else. [/mepr-show]

    Shortcode MEPR-HIDE:
    [mepr-hide if=”rule: 32171″] This content is shown to everyone except authorized members. [/mepr-hide]

    PHP Snippet (This is similar to the first shortcode, but is used in places where shortcodes don’t work):
    <?php if(current_user_can(‘mepr-active’,’rule: 32171′)): ?> Content to protect goes inbetween. <?php endif; ?>

    So I need to put the first shortcode pair around the reviews, and then also put in the second shortcode pair around text saying “Only Skidaway Island residents can post or read reviews.”

    Do you know how I can do that?

    Do I need to create a child function for the plugin?

    Thanks for your suggestions.

    -James

    #428948

    Alex Rollin
    Moderator
    Post count: 27815

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

Viewing 2 posts - 1 through 2 (of 2 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount