Answering role based questions

Solved4.48K viewsUpdates
0

Is there a way that you can make roles, which i created, can make answer only the questions with a specific tag.

For example:

A role which i created is called “AnsPress Soccer” and “AnsPress Golf”

I want this role “AnsPress Soccer” to answer only the questions with a tag soccer and the roleĀ “AnsPress Golf” only the questions with tag golf.

Is there a posibility to put an if somewhere?

0

Yes it can be done. You can check if current question have the tag you need and check user role:

<?php
global $wp_roles;
$current_user = wp_get_current_user();
$roles = $current_user->roles;

if( has_term( 'soccer', 'question_tag') && $roles == 'anspress_soccer' ) {
    // do something
}

In what file does this happen? Where can i add my statements?

questions.php

You are viewing 1 out of 1 answers, click here to view all answers.