ご注意!

この記事には PHP コードが含まれており、開発者を対象としています。このコードは便宜上提供していますが、コードのカスタマイズやサードパーティの開発についてはサポートを提供していません。

追加のガイダンスについては、WPBeginner の カスタムコードの追加方法に関するチュートリアル を参照してください。

閉じる

説明

wpforms_user_registration_process_registration_process_user_email_exists_error_messageフィルターは、ユーザー登録アドオンでメールアドレスが既に存在する場合にメッセージを提供するのに使用されていました。

パラメーター

$msg
(string) メールアドレスが以前に使用されている場合に表示されるメッセージ。

ソース

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

詳細情報

このフィルターは、メールアドレスが別のユーザーですでに存在する場合にユーザーにメッセージを表示するために使用されます。

/**
 * Check email address exists.
 *
 * @link    https://wpforms.com/developers/wpforms_user_registration_process_registration_process_user_email_exists_error_message/
 *
 * @param   string   $msg  Message that displays if email exists.
 * @return  string
 */

function wpf_dev_user_registration_email_exists( $msg ) {
 
    // This is the message that would appear
    $msg =  __('A user with that username already exists. Please <a href="http://yourdomain/wp-admin/">log in here</a> to your account.', 'text-domain');
 
    return $msg;
}
 
add_filter( 'wpforms_user_registration_process_registration_process_user_email_exists_error_message', 'wpf_dev_user_registration_email_exists', 10, 1 );

参考記事

\ユーザー登録アドオンの検証メッセージを変更する方法