geminilabs

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

Sep 3rd, 2021 (edited)
455
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.26 KB | None | 0 0
  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);
Add Comment
Please, Sign In to add comment