admin管理员组文章数量:1122846
I hope someone can help or had the same problem, because I don't know how to get to a solution.
I am trying to customize the registration email of new users, where the password set link is. For the whole customization, I use a "template" from codewp. My problem is that i can't get the user_activation_key into the url and I don't know why. I tried several things but now I don't know what to do anymore.
When I leave it as it is in the template, I get the username but not the key.
$message .= "<a $link_style href='" . network_site_url( "change-password/?wpforo=resetpassword&rp_key=". rawurlencode( $user->user_activation_key ), 'key' . " &login=" . rawurlencode( $user->user_login ), 'login' ) . "'>" . __( 'Set Your Password' ) . "</a>";
Here the URL i get from this:
Then I tried doing it the same way for the password, as they did for the login in the code:
$message .= "<a $link_style href='" . network_site_url( "change-password/?wpforo=resetpassword&rp_key=rp&key=$user->user_activation_key&login=" . rawurlencode( $user->user_login ), 'login' ) . "'>" . __( 'Set Your Password' ) . "</a>";
Here, I got nothing back.
I am very new to "coding" so there's probably some easy fix but I can't find a solution.
Thank a lot in advance! Markus
The Function in wpforo:
function wpforo_lostpassword_url( $redirect_to = null ) { if( wpforo_setting( 'authorization', 'lost_password_url' ) ) { $lostpassword_url = trim( (string) get_bloginfo( 'url' ), '/' ) . '/' . ltrim( (string) wpforo_setting( 'authorization', 'lost_password_url' ), '/' ); } else { if( wpforo_setting( 'authorization', 'use_our_lostpassword_url' ) ) { $lostpassword_url = wpforo_url( wpforo_get_redirect_to_url_path( $redirect_to ), 'lostpassword' ); } else { if( is_null( $redirect_to ) ) $redirect_to = wpforo_get_redirect_to(); $lostpassword_url = wp_lostpassword_url( $redirect_to ); } } $lostpassword_url = apply_filters( 'wpforo_lostpassword_url', $lostpassword_url ); return esc_url_raw( $lostpassword_url ); }
I hope someone can help or had the same problem, because I don't know how to get to a solution.
I am trying to customize the registration email of new users, where the password set link is. For the whole customization, I use a "template" from codewp. My problem is that i can't get the user_activation_key into the url and I don't know why. I tried several things but now I don't know what to do anymore.
When I leave it as it is in the template, I get the username but not the key.
$message .= "<a $link_style href='" . network_site_url( "change-password/?wpforo=resetpassword&rp_key=". rawurlencode( $user->user_activation_key ), 'key' . " &login=" . rawurlencode( $user->user_login ), 'login' ) . "'>" . __( 'Set Your Password' ) . "</a>";
Here the URL i get from this:
Then I tried doing it the same way for the password, as they did for the login in the code:
$message .= "<a $link_style href='" . network_site_url( "change-password/?wpforo=resetpassword&rp_key=rp&key=$user->user_activation_key&login=" . rawurlencode( $user->user_login ), 'login' ) . "'>" . __( 'Set Your Password' ) . "</a>";
Here, I got nothing back.
I am very new to "coding" so there's probably some easy fix but I can't find a solution.
Thank a lot in advance! Markus
The Function in wpforo:
Share Improve this question edited Jun 18, 2024 at 11:48 Markus Pfister asked Jun 18, 2024 at 6:06 Markus PfisterMarkus Pfister 11 bronze badge 2function wpforo_lostpassword_url( $redirect_to = null ) { if( wpforo_setting( 'authorization', 'lost_password_url' ) ) { $lostpassword_url = trim( (string) get_bloginfo( 'url' ), '/' ) . '/' . ltrim( (string) wpforo_setting( 'authorization', 'lost_password_url' ), '/' ); } else { if( wpforo_setting( 'authorization', 'use_our_lostpassword_url' ) ) { $lostpassword_url = wpforo_url( wpforo_get_redirect_to_url_path( $redirect_to ), 'lostpassword' ); } else { if( is_null( $redirect_to ) ) $redirect_to = wpforo_get_redirect_to(); $lostpassword_url = wp_lostpassword_url( $redirect_to ); } } $lostpassword_url = apply_filters( 'wpforo_lostpassword_url', $lostpassword_url ); return esc_url_raw( $lostpassword_url ); }
- Can you post text please and not images? You can use code formatting (backticks) or block quotes ( > ) to make it stand out. – Rup Commented Jun 18, 2024 at 8:04
- Sorry, didn't know how to do it properly. Should be right now. – Markus Pfister Commented Jun 18, 2024 at 10:02
1 Answer
Reset to default 0I have no idea how this plays with wpForo, but in the standard reset flow rp_key is extracted from the password reset cookie. See wp-login.php:
$rp_cookie = 'wp-resetpass-' . COOKIEHASH;
if ( isset( $_COOKIE[ $rp_cookie ] ) && 0 < strpos( $_COOKIE[ $rp_cookie ], ':' ) ) {
list( $rp_login, $rp_key ) = explode( ':', wp_unslash( $_COOKIE[ $rp_cookie ] ), 2 );
You'd have to look at the wpForo code or ask them for help / documentation if they do something different.
本文标签: wp user queryEmail CustomizationCan39t get useractivationokey
版权声明:本文标题:wp user query - Email Customization - Can't get user_activationo_key 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736303459a1931893.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论