Title: User Profile Fields Shortcode
Last modified: December 15, 2021

---

# User Profile Fields Shortcode

 *  Resolved [you4eea](https://wordpress.org/support/users/you4eea/)
 * (@you4eea)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/user-profile-fields-shortcode/)
 * Are there any other user field shortcodes that can be used for the messages sent
   on BP Registration page in dashboard. Example, First Name, Last Name, Nickname,
   Display Name?
 * Link to screenshot with additional notes.
    [https://www.screencast.com/t/oEQlg6vE](https://www.screencast.com/t/oEQlg6vE)
    -  This topic was modified 4 years, 5 months ago by [you4eea](https://wordpress.org/support/users/you4eea/).

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [4 years, 5 months ago](https://wordpress.org/support/topic/user-profile-fields-shortcode/#post-15166705)
 * Good day [@you4eea](https://wordpress.org/support/users/you4eea/)
 * Out of box, no we’ve stuck with just the two mentioned ion our dashboard thus
   far. However, we do have some code-based methods available to add your own if
   you wanted. I am not sure how code-savvy you are, but I have provided a quick
   example for a user’s first name below, which would allow for using a `[firstname]`
   placeholder. There is a comment provided in the snippet as well to help explain
   what some of the parts are.
 *     ```
       function bpro_support_extra_placeholders( $message_parts, $user ) {
       	/**
       	 * The $message_parts variable will have 3 indexes:
       	 * user_email: holding the email address of the user being moderated
       	 * user_subject: email subject line
       	 * user_message: the message for the appropriate moderation action being performed.
       	 * 
       	 * You'll want to parse out any custom shortcodes matching in a similar way below, fetching the user data as needed using the passed $user object.
       	 */
       	$firstname = get_user_meta( $user->data->ID, 'first_name', true );
       	$message_parts['user_message'] = str_replace( '[firstname]', $firstname, $message_parts['user_message'] );
   
       	return $message_parts;
       }
       add_filter( 'bpro_hook_before_email', 'bpro_support_extra_placeholders', 10, 2 );
       ```
   
 * Let me know if you need some help with this, or have some questions/concerns 
   about anything.
 *  Thread Starter [you4eea](https://wordpress.org/support/users/you4eea/)
 * (@you4eea)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/user-profile-fields-shortcode/#post-15166820)
 * WOW… YOU ROCK!
    Exactly what I needed..
 * Got it..
    Threw into my functions.php file in child-theme and BAMM!
 * Worked perfectly..
 * Thanks!
    -  This reply was modified 4 years, 5 months ago by [you4eea](https://wordpress.org/support/users/you4eea/).
 *  [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [4 years, 5 months ago](https://wordpress.org/support/topic/user-profile-fields-shortcode/#post-15167143)
 * Welcome. Let us know if you need anything else.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘User Profile Fields Shortcode’ is closed to new replies.

 * ![](https://ps.w.org/bp-registration-options/assets/icon-256x256.png?rev=2882040)
 * [Registration Options for BuddyPress](https://wordpress.org/plugins/bp-registration-options/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/bp-registration-options/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/bp-registration-options/)
 * [Active Topics](https://wordpress.org/support/plugin/bp-registration-options/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bp-registration-options/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bp-registration-options/reviews/)

## Tags

 * [messages](https://wordpress.org/support/topic-tag/messages/)
 * [user fields](https://wordpress.org/support/topic-tag/user-fields/)

 * 3 replies
 * 2 participants
 * Last reply from: [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * Last activity: [4 years, 5 months ago](https://wordpress.org/support/topic/user-profile-fields-shortcode/#post-15167143)
 * Status: resolved