A Cozmoslabs Product

Modify Logged In messages

Filter the logged in message from the PB login form

This function will change the logged in message.

Make sure to:

  • change text on line 6

wppb_login_message is located in Profile Builder: /front-end/login.php

1
2
3
4
5
6
7
/*
 * Filter the logged in message from the PB login form. Tags: logged in, login
 */
add_filter('wppb_login_message', 'wppbc_custom_logged_in_msg', 10, 3);
function wppbc_custom_logged_in_msg($logged_in_message, $user_id, $display_name){
	return '<p class="wppb-alert">'.sprintf(__( 'You are currently logged in as %1$s.', 'profilebuilder' ), '<a href="'.$authorPostsUrl = get_author_posts_url( $user_id ).'" title="'.$display_name.'">'.$display_name.'</a>' ) . '</p><!-- .alert-->';
}

Filter the logged in message from the PB login form to support a different user url

This function will change the logged in message to support a different user url.

Make sure to:

  • change text on line 8
  • change link in $user_url variable on line 6
  • change Log Out text in $logout_url variable on line 7
1
2
3
4
5
6
7
8
9
/*
 * Filter the logged in message from the PB login form to support a different user url.
 */
add_filter('wppb_login_message', 'wppbc_custom_logged_in_msg_2', 10, 3);
function wppbc_custom_logged_in_msg_2($logged_in_message, $user_id, $display_name){
	$user_url = '<a href="http://sitename.com/edit-profile" class="wppb-author-url" title="'.$display_name.'">'.$display_name.'</a>';
	$logout_url = '<a href="'.wp_logout_url( $redirectTo = wppb_curpageurl() ).'" class="wppb-logout-url" title="'.__( 'Log out of this account', 'profilebuilder' ).'">'. __( 'Log out', 'profilebuilder').' &raquo;</a>';
	return '<p class="wppb-alert">' . sprintf(__( 'You are currently logged in as %1$s. %2$s', 'profilebuilder' ), $user_url, $logout_url ) . '</p><!-- .alert-->';
}

Profile Builder Pro

Create beautiful front-end registration and profile forms with custom fields. Setup member directories, custom redirects, cutomize user emails & more using the all in one user management plugin.

Get Profile Builder

The Ultimate Membership Bundle

Combine the power of Profile Builder with Paid Member Subscriptions to set up user registration, memberships, and recurring revenue.

Get 25% off with the bundle

Help & Support

We’re here to help you every step of the way.

Open a Support Ticket