This function adds a shortcode that allows you to display meta fields that a specific/current user has.
To be able to use the shortcode below you will first need to go to the Dashboard -> Profile Builder -> Settings -> Advanced Settings -> Shortcodes -> and check “Enable Usermeta shortcode”.
Shortcode:
[user_meta key=”avatar”]
Parameters:
- user_id – id of the user which you want to retrieve the meta from. Leave empty if it should be equal to the current user.
- key – meta key of the field that you want to retrieve
- wpautop = “on” – this is used for textarea or wysiwyg fields
- size = “100” – this is used for the avatar field to specify the size of it