geminilabs

[site-reviews] Use the user nickname as the response-by name

Sep 3rd, 2021 (edited)
193
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. add_filter('site-reviews/review/build/tag/response/by', function ($responseBy, $review) {
  2.     if ($user = get_userdata($review->meta()->_response_by)) {
  3.         $responseBy = get_user_meta($user->ID, 'nickname', true);
  4.     }
  5.     return $responseBy;
  6. }, 10, 2);
RAW Paste Data Copied