Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics
fabian

User display format in filter

When selecting a customer in the filter of the order grid, the name is displayed in the following format: Name (#ID – Email)
Is there any way to change the display format, e.g. remove the ID or email?

3 years, 10 months ago
Tobias Schutter
Developer

No, there is no hook or filter in place to do so, but in the next patch, I will add a filter you can use. It will be something like acp/select/formatter/user_name. Keep an eye on the changelog for the exact naming.

Here is an example of how it should work:

add_filter( 'acp/select/formatter/user_name', function( $label, WP_User $user ) {
	$label = ac_helper()->user->get_display_name( $user, 'full_name' );

	return $label;
}, 10, 2 );

I have used our helper function to format the user name, but you can write your own logic of course.

Thank you for another great suggestion!

3 years, 10 months ago

You must be logged in to reply to this topic.