Hi, I'm using membermouse to have tiered content for users. I would like to use wpDiscuz only for VIP users. I can do this if I use shortcode on any page or php or JS to insert the plugin but I can't do it just by using the plugin itself.Â
Â
Is it possible to insert the comments specifically so certain users can't see it?
Hi @drenglishadam,
Thank you for your interest in wpDiscuz and for contacting us.
I'm really sorry, but wpDiscuz doesn't have such feature.Â
If you're a developer you can do it using the following wpDiscuz shortcode:Â Â
function my_wpdiscuz_shortcode() {
if (file_exists(ABSPATH . 'wp-content/plugins/wpdiscuz/templates/comment/comment-form.php')) {
ob_start();
include_once ABSPATH . 'wp-content/plugins/wpdiscuz/templates/comment/comment-form.php';
return ob_get_clean();
}
}
add_shortcode('wpdiscuz_comments', 'my_wpdiscuz_shortcode');
Thanks! so is it possible to install the plugin but disable it so it doesn't appear on every page and just use this code when appropriate?
Hi @drenglishadam,
Please let us know would you prefer to disable the whole commenting part for non-members or you'd like display comment WordPress commenting form for these members? Â
I prefer to disable the whole commenting part for non members
You should use some additional code for this purpose. Something like the following one I'm providing below:Â
$user = wp_get_current_user();
if ( in_array( 'subscriber', (array) $user->roles ) ) {
comments_template();
}
In this example, the comment section is disabled for the subscriber user role.Â
Thank you so much!Â
Â
Just to confirm, this extra code enables or disabled it for subscribers?
The code I've provided is disabled the commenting for subscribers.Â