Add real-time features to messages

I like it! The one thing I would suggest is providing the ability to add it to the account menu only if the user has sent at least one message, to make it more intuitive for HivePress. This code allows you to add an item to the menu:

add_filter(
	'hivepress/v1/menus/user_account',
	function( $menu ) {
		$menu['items']['custom_name_here'] = [
			'label'  => 'Conversations',
			'url'    => 'custom url here',
			'_order' => 20,
		];

		return $menu;
	}
);

There would need to be some additional code added here to display it only after the user has messaged one person.

3 Likes