<html lang="ja-jp" dir="ltr"><head></head><body>### [wpforms_user_registration_process_registration_process_username_exists_error_message](https://wpforms.com/developers/wpforms_user_registration_process_registration_process_username_exists_error_message/)

**公開日:** 2020年3月31日
**著者:** エディトリアルチーム

**抜粋:** wpforms_user_registration_process_registration_process_username_exists_error_messageフィルターは、ユーザー登録アドオンを使用しており、ユーザー名が既に存在する場合にメッセージを表示するために使用されます。

**コンテンツ:**

## 説明

`wpforms_user_registration_process_registration_process_username_exists_error_message`フィルターは、ユーザー名が既に存在する場合にユーザー登録アドオンでメッセージを提供するために使用されます。

## パラメータ

$msg*(string)* ユーザー名が既に存在する場合に表示されるメッセージ。## ソース

`wpforms-user-registration/src/Process/Registration.php`

## 詳細情報

ユーザー名が既に存在する場合にメッセージを表示するためにフィルターが使用されます。

## 例

```

/**
 * ユーザー名が既に存在します。
 *
 * @link    https://wpforms.com/developers/wpforms_user_registration_process_registration_process_username_exists_error_message/
 *
 * @param   string   $msg  ユーザー名が既に存在する場合に表示されるメッセージ。
 * @return  string
 */

function wpf_dev_user_registration_username_exists( $msg ) {
 
    // 表示されるメッセージはこちらです
    $msg =  __('そのユーザー名は既に存在します。こちらからログインしてください。', 'text-domain');
 
    return $msg;
}
 
add_filter( 'wpforms_user_registration_process_registration_process_username_exists_error_message', 'wpf_dev_user_registration_username_exists', 10, 1 );

```

## 参考記事

[ユーザー登録アドオンの検証メッセージを変更する方法](https://wpforms.com/developers/change-validation-messages-for-user-registration-addon/ "ユーザー登録アドオンの検証メッセージを変更する方法")

**カテゴリ:** フィルターフック

**タグ:** PHP、ユーザー登録アドオン

---</body></html>