• Hello
    I think will be very usefully insert in the first message also the name of user the try contact me

    thanks
    very good job
    Lorenz

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Creame

    (@creapuntome)

    It’s a good idea but we need to think an alternative if the user it’s not logged.

    By now if you need it, you can add this code to your theme functions.php:

    // Add {USERNAME} replacement for Join.chat.
    function joinchat_add_username_replacement ( $replacements ) {
      $replacements['USERNAME'] = is_user_logged_in() ? wp_get_current_user()->display_name : 'friend';
      return $replacements;
    }
    add_filter( 'joinchat_variable_replacements', 'joinchat_add_username_replacement' );

    Note if the user isn’t logged use “friend” instead.

    I share this solution that works best when using WooCommerce

    // Add {USERNAME} replacement for Join.chat.
    function joinchat_add_username_replacement ( $replacements ) {
      $replacements['USERNAME'] = is_user_logged_in() ? wp_get_current_user()->first_name : 'friend';
      return $replacements;
    }
    add_filter( 'joinchat_variable_replacements', 'joinchat_add_username_replacement' );
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘vars {user_name}’ is closed to new replies.