• Resolved Alexandra

    (@avsalexandra)


    How can I display only customer’s name in reviews, and not first and last name?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Alexandra

    (@avsalexandra)

    I found a solution. And you can hide the name and mail form in the form:
    .cr-review-form-ne{display:none;}

    add_filter( 'get_comment_author', 'wpse_use_user_first_name_only', 10, 3 );
    function wpse_use_user_first_name_only( $author, $comment_id, $comment ) {

    $firstname = '';
    $user_id = $comment->user_id;
    if ( $user_id ) {
    $user_object = get_userdata( $user_id );
    $firstname = $user_object->user_firstname;
    }
    if ( $firstname ) {
    $author = $firstname;
    }
    return $author;
    }
    Plugin Support pistachio6321

    (@pistachio6321)

    Thank you for starting a topic and then sharing a solution ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.