Created
April 19, 2021 11:01
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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