Support » Plugin: BP Member Reviews » Select with users have reviews

  • Resolved lricopan

    (@lricopan)


    hi, my english is not quite good so im goin to be very direct. I want to have the reviews only in certain type of users of my buddypress proyect, in example, i have trainers and students, so i want to only the trainers to have reviews. its that posibble using your plugin? if the answer is yes, where in the code i should add the conditional?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author wordplus

    (@wordplus)

    Hi there!

    You should use something like this:

    function filter_function($allow, $reviewer_id, $reviewed_id){
    
    if($reviewed_allowed){
        return true; 
    } else {
        return false
    }
    
    }
    add_filter( 'bp_members_reviews_review_allowed', 'filter_function', 10, 3 );

    Thank you very much,I understant the main idea of the code. There is a function (bp_members_reviews_review_allowed)
    in your plugin that ask if the user is allowed to receive reviews,so I have to tell him every time true or false when the function is call.I’m right? . If I’m right then I only have a doubt about the mean of the 2 last parameters (10,3 in this case) you added to the add_filter() function.
    I’m quite new in WordPress, sorry if my question is too basics.

    Plugin Author wordplus

    (@wordplus)

    Hi there!

    10 – is filter order, bigger int = later execution
    3 – number of function arguments

    Check WordPress Codex for more info about add_filter function.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Select with users have reviews’ is closed to new replies.