Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jreviews
Created April 19, 2021 11:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jreviews/87a2ed555a47f080cee92516ba8adae2 to your computer and use it in GitHub Desktop.
Save jreviews/87a2ed555a47f080cee92516ba8adae2 to your computer and use it in GitHub Desktop.
JReviews filter to hide `write review` in action buttons area for listing owners
<?php
Clickfwd\Hook\Filter::add('listing_list_action_buttons', 'jreviews_hide_write_review_for_owners');
Clickfwd\Hook\Filter::add('listing_detail_action_buttons', 'jreviews_hide_write_review_for_owners');
function jreviews_hide_write_review_for_owners($buttons, $params)
{
if (S2Object::make('auth')->id == $params['listing']['User']['user_id']) {
unset($buttons['write_review']);
}
return $buttons;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment