Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Get Logged-In User Profile Link URL?

@ckchaudhary

Participant

You can wrap it in a shortcode.
Add following in your functions.php file:

add_shortcode( 'CUSER-PROFILE', 'cuser_profile_shortocode_handler' );
function cuser_profile_shortocode_handler( $atts ){
	$atts = shortcode_atts( array( 
		'text'		=> 'my profile',
	), $atts );
	
	if( !is_user_logged_in() )
		return '';
	
	$link = home_url( '/hbcmembers/' . bp_core_get_username( get_current_user_id() ) . '/profile/' );
	return "<a href='". esc_attr( $link ) ."'>" . $atts['text'] . "</a>";
}

Then you can add [CUSER-PROFILE text=”Edit Profile”] in html block etc..

Skip to toolbar