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.