Please or Register to create posts and topics.

Using a shortcode from another plugin to hide forum content

Hello,

I need to use a restriction-content shortcode from the plugin https://simple-membership-plugin.com and to apply this content-restriction to some displayed elements of the Asgaros forum.

Precisely, I want to hide the new topic form (all its elements : title, content, submit button…). Thus, it could show only a specific message to the users who have the restriction. This message and the restriction are completely managed by the above plugin.

By testing the shortcode allowing that, the opening bracket of the shortcode is OK : the message is displayed.
But the closing bracket is not considered as a shortcode (always displayed as a simple text). The consequence is that the shortcode is not interpreted, and the form that I want to want is displayed.

Modified file : includes/forum-editor.php

Used shortcode, 2 ways :
echo do_shortcode(‘[swpm_protected for=”2-3″]’);
echo do_shortcode(‘[/swpm_protected]’);
//or
<?php echo do_shortcode(‘[swpm_protected for=”2-3″]’); ?>
<?php echo do_shortcode(‘[/swpm_protected]’); ?>

 

Do you see how I could manage that ? Where to place precisely this shortcode ?

I hope this topic is not too specific about the other plugin. I think it is more about the management / integration of shortcodes to Asgaros forum, so that could help many users.

Thanks you so much for your help,

Law

Hello @alcandau

Please check out my answer here:

https://wordpress.org/support/topic/using-a-shortcode-from-another-plugin-to-hide-forum-content/

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!