Reply To: Tom here's my code for your new rego/profile button

Home Forums Support Tom here's my code for your new rego/profile button Reply To: Tom here's my code for your new rego/profile button

#205794
Max

Tom

I fixed this.

Here is the final code that is good to go (change from user_login to user_nicename):


/GP rego and profile shortcode [gp_rego]

add_shortcode( 'gp_rego', 'gp_rego' );
function gp_rego() {
	if ( ! is_user_logged_in() ) {
		return '<a class="button see-through login-button" href="' . esc_url( wp_registration_url( get_permalink() ) ) . '">Register</a>';
	} else {
		$current_user = wp_get_current_user();
		$user=$current_user->user_nicename ;
		return '<a class="button see-through login-button" href="http://localhost/forum/forums/users/' . $user . '/edit">My Profile</a>';
	}
}

Kind Regards

Max