New Plugin Adds Taxonomies to BuddyPress Groups

photo credit: H. Michael Arrighi - cc
photo credit: H. Michael Arrighicc

The groups component in BuddyPress allows members to create their own mini-social networks, each with its own homepage, activity stream, member directory and administrative panel. In networks where groups play a big part of the social activity, it becomes important to have a way to label or classify groups. When a group doesn’t have a full description, it’s not easy to differentiate it from the others or find similar groups.

BuddyPress core doesn’t yet have native support for group taxonomies, but the possibility is on the horizon with a ticket open for discussion. In the meantime, Mathieu Viet has created a solution. Viet, better known as @imath, is a BuddyPress core developer and author of Alternative Public Group Control, an experimental plugin that adds finer control for public groups.

As part of his professional life, @imath supports a social network that was in need of group taxonomies in order to help new members get connected to the right groups. He found that the existing BuddyPress Groups Tag plugin didn’t work for him conceptually, because it relies on “groupmetas” to power the tagging features. @imath felt that groupmetas are better used to describe groups rather than to classify them.

BP Groups Taxo Plugin Created to Add Tags to BuddyPress Groups

BP Groups Taxo is another experimental plugin that he created in order to provide a solution that would be maintainable over time. After researching, he found a way to register a custom taxonomy in order to provide tags for the groups component.

The plugin allows group administrators to select tags when creating a new group.

group-creation

With very little code, @imath was able to create an administration interface that allows admins/super admins to quickly add group tags. This screen is located under Groups >> Group Tags:

group-tags-admin

Groups will appear on the frontend in the directory with their corresponding tags:

groups-directory

Additionally, the plugin includes the ability to render the BuddyPress groups taxonomy within a tag cloud widget for displaying anywhere on the site.

@imath submitted a patch to BuddyPress core as a first pass at including group taxonomies, which would of course render his experimental plugin obsolete. The method essentially involves “faking a post type” in order to take advantage of the WordPress taxonomy API. There isn’t yet a clear path forward until WordPress resolves some long-term architecture challenges surrounding taxonomy meta and post relationships.

If BuddyPress core contributors are to add support for group taxonomies, they will have to take the planned changes for WordPress into consideration. The discussion continues on this topic. For now, the BP Groups Taxo plugin is the best option for adding group tags to your BuddyPress site. Be advised that it’s still experimental and not yet ready for use in production. @imath welcomes your feedback and suggestions for the plugin on GitHub.