簡體   English   中英

Wordpress buddypress 2.6.1.1激活電子郵件消息修改

[英]Wordpress buddypress 2.6.1.1 activation email message amend

我試圖在上面更改用戶激活電子郵件。 搜索並閱讀了許多與新版本無關的鏈接。

對於某些用戶,我遇到的問題是激活鏈接無法正常工作,並且要求他們在指向的頁面上輸入激活密鑰。

目前,我的修復程序(如果我可以解決問題,請更改修復程序以掛接到相關操作中)涉及更改'bp-core-functions.php'文件,修改消息以包括對實際密鑰的引用,用戶可以根據需要復制和粘貼。

 'core-user-registration' => array(
        /* translators: do not remove {} brackets or translate its contents. */
        'post_title'   => __( '[{{{site.name}}}] Activate your account', 'buddypress' ),
        /* translators: do not remove {} brackets or translate its contents. */
        'post_content' => __( "Thanks for registering!\n\nTo complete the activation of your account, go to the following link: <a href=\"{{{activate.url}}}\">{{{activate.url}}}</a>. Or enter the following key if prompted: {{{key}}}", 'buddypress' ),
        /* translators: do not remove {} brackets or translate its contents. */
        'post_excerpt' => __( "Thanks for registering!\n\nTo complete the activation of your account, go to the following link: {{{activate.url}}}.  Or enter the following key if prompted: {{{key}}}", 'buddypress' ),
    ),

Ive還更改了.pot文件中的相同消息。。。只是因為這些消息也位於它們的內部。。。只是為了嘗試使此更改生效。

它不起作用。 任何人都不知道我如何更改發送給用戶的激活相關消息?

謝謝肖恩

試試這個代碼。

    //  Get the slug of the activation page
    $slug = $bp->pages->{"activate"}->slug;

    //  Get username from the signup form just posted
    $username = $bp->signup->username;

    //  SQL query to get activation key for that username
    $sql = 'select meta_value from wp_usermeta where meta_key="activation_key" and user_id in (select ID from wp_users where user_login="' . $username . '" and user_status=2)';

    //  Getting the activation key from the database
    $activation_key = $wpdb->get_var($sql);



    //  Custom message with activation key
    $message = "Yayy! Thanks for signing up! Please confirm your account!\n\n$activation_key";

    return $message;
}
?>

將其粘貼到插件文件夾中的bp-custom.php中

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM