是否有用于预填充用户的Gravatar注册链接';谁的电子邮件地址?

是否有用于预填充用户的Gravatar注册链接';谁的电子邮件地址?,gravatar,Gravatar,我希望这样的事情能奏效 http://en.gravatar.com/site/signup?email=user%40example.com 避免用户重新键入电子邮件。它已更改。现在必须首先计算md5散列。像这样: http://www.gravatar.com/avatar/[MD5电子邮件]?s=[gravatar的大小] 例如: 我注意到它是为用户处理的(还有很多其他东西),所以我仔细研究了一下他的代码,他使用了以下PHP函数: /** * Get URL to locale gra

我希望这样的事情能奏效

http://en.gravatar.com/site/signup?email=user%40example.com

避免用户重新键入电子邮件。

它已更改。现在必须首先计算md5散列。像这样:

http://www.gravatar.com/avatar/[MD5电子邮件]?s=[gravatar的大小]

例如:

我注意到它是为用户处理的(还有很多其他东西),所以我仔细研究了一下他的代码,他使用了以下PHP函数:

/**
 * Get URL to locale gravatar signup page
 *
 * @since 2.0
 * @param string $email Email address that should be apended
 * @return string $gse_url URL of locale signup page
 */
function gravatar_signup_encouragement_locale_signup_url( $email = '' ) {
    /* translators: Locale gravatar.com, e.g. sr.gravatar.com for Serbian */
    $gse_locale_url = _x( 'en.gravatar.com', 'Locale gravatar.com, e.g. sr.gravatar.com for Serbian', 'gse_textdomain' );

    /* Check if it's really locale.gravatar.com */
    if ( preg_match( '|^[A-Z_%+-]+.gravatar+.com|i', $gse_locale_url ) ) {
        $gse_locale_url = $gse_locale_url;
    } else {
        $gse_locale_url = 'en.gravatar.com';
    }

    /* If email exists, append it */
    if ( empty( $email ) ) {
        $gse_url = "http://" . $gse_locale_url . '/site/signup/';
    } else {
        $encoded_email = urlencode( $email );
        $gse_url = "http://" . $gse_locale_url . '/site/signup/' . $encoded_email;
    }

    return $gse_url;
}
不幸的是,自从Wordpress用oauth帐户接管表单以来,这可能不再起作用了,所以这里是我的RubyonRails转换解决方案。重要的一点是HTTP参数
用户电子邮件
存在并工作:

  def gravatar_create_url(user)
     user_email = u user.email.downcase
     "https://signup.wordpress.com/signup/?ref=oauth2&user_email=#{user_email}&oauth2_redirect=bf551c93d83b96478db51481a9cbe97e%40https%3A%2F%2Fpublic-api.wordpress.com%2Foauth2%2Fauthorize%2F%3Fclient_id%3D1854%26response_type%3Dcode%26blog_id%3D0%26state%3D331f9ecba5fcab15e2168e1231f7be2a4b1b8cd24dd6f90b3672fb5159d7b590%26redirect_uri%3Dhttps%253A%252F%252Fen.gravatar.com%252Fconnect%252F%253Faction%253Drequest_access_token%26jetpack-code%26jetpack-user-id%3D0%26action%3Doauth2-login&wpcom_connect=1"
  end

我不确定所有其他重定向参数,因为随着Wordpress如何接管Gravatar,这些参数可能会随着时间的推移而改变,但希望这能让您朝着正确的方向前进。

只是提取toobulkeh的答案(应该接受),并使其与实现无关

使用注册页面url上的用户电子邮件查询参数


它现在使用md5。我修正了我的答案这是如何获得图像。。。如果他们没有gravatar帐户,我想在注册页面上预先填入他们的电子邮件地址…这是获取图像的方法,而不是链接到登录页面的方法