Skip to main content

better_messages_rest_user_item

REQUIREMENTS

To be able to implement this guide, you need to learn how to insert PHP snippets to your website.

You can find guide here: WP Beginner

This filter allows to filter user data returned by Better Messages rest api.

The changes will affect every part of Better Messages interface.

add_filter('better_messages_rest_user_item', 'custom_user_meta', 50, 3 );

function custom_user_meta( $item, $user_id, $include_personal ){
// Set custom profile URL (if set this to false the user links becomes unclickable)
$item['url'] = 'https://www.wordplus.org/custom-profile';
// Set custom avatar URL
$item['avatar'] = 'https://www.wordplus.org/custom-avatar.png';
// Set custom name
$item['name'] = 'Custom name';

return $item;
}