Disable listing owner to leave reviews on their own listing

This topic contains 2 replies, has 2 voices, and was last updated by  gowrann 1 year, 7 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #542620

    gowrann
    Expired Member
    Post count: 39

    How do you disable a listing owner to leave reviews on their own listing?

    Thanks

    #542710

    Alex Rollin
    Moderator
    Post count: 27815

    You can disable comments for specific users by using hooks.
    You can use hook “comments_open” to disable comments for owner. You have to write logic so it only executed on detail page & for owners only.
    See https://developer.wordpress.org/reference/hooks/comments_open/

    #543038

    gowrann
    Expired Member
    Post count: 39

    Hi Alex – yes that works well – I have a multiple role site and I want only 1 role to rate and review – this works well

    
    if ( ! current_user_can( 'parent' ) ) 
        add_filter( 'comments_open', '__return_false' );
    

    So above any role other than the ‘parent’ role cannot leave a review.

Viewing 3 posts - 1 through 3 (of 3 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket