Filter: name parts

Hook
peepso_get_name_parts
Plugin PeepSo Foundation
Since 1.8.2
Status Active
Args
array

Description #

This filter is used to gather and order “parts” used to display the user’s name. The default “parts” are: the real name (first name & last name), or username,ย depending on availability of the data and the settings.

Practical uses of this filter can include: changing the order of the name parts, adding a middle name or a nickname, removing last names from display etc.

When working with this filter, always assume you will have access to one or more parts, never assume a specific number.

For example, admin or user might decide to only show username (by using the “display name style” settings). Sometimes the real name has not been provided. In these cases the username will be available.

Sometimes the real name is used, but last name is missing – then only the first name will be available.

Limitations #

Do not use this filter to add rich HTML to name parts. This should be done with actions: peepso_action_render_user_name_before and peepso_action_render_user_name_after.

Examples #

What are your feelings
Updated on September 22, 2023