Skip to:
Content
Pages
Categories
Search
Top
Bottom

Extending Groups


  • techguy
    Participant

    @crashutah

    I’m just now starting to dig in extending some of the group functionality in BP. What I’m trying to get my head around is it seems like there’s a bunch of ways to expand the functionality of groups and I’d love to learn the advantages and disadvantages of each method.

    First, you could just add changes to the theme files.
    Second, you could use a regular plugin and hook it into the group actions.
    Third, you could use the Group Extension API.

    It also seems like you could store some data for each group either in:
    1. wp_sitemeta
    2. wp_bp_groups_groupmeta
    3. A new table created by a plugin

    Lots of methods to extend/modify the group functionality (feel free to add any I might have missed). It’s nice to have options, but I’d love to hear people’s feedback on when they’d use the group API versus just a plugin or the theme. I’m sure there’s different philosophies and advantages and disadvantages to different options. I’d love to hear what people have learned about this.

Viewing 3 replies - 1 through 3 (of 3 total)

  • Anonymous User 96400
    Inactive

    @anonymized-96400

    Why would you use wp_sitemeta to store data about a group? Doesn’t really make sense to me. This table is for storing data about your site, not about a group. Also, this table doesn’t exist in a single WP install, so it’d be kinda counter-productive. If you need to store data about a group, then store it in the proper table, which is wp_bp_groups_groupmeta.

    As for metadata tables vs creating your own plugin tables, it just depends on what your needs are. Metadata tables are fine for kinda static, small pieces of data, while you would use a custom table for data that grows with time.

    A plugin that modifies or adds to group functionality will most likely utilize the groups API. This is suitable for adding more complex functionality. More basic functionality can be added by using the various action calls you can find in the template files. Again, it really depends on what you’re trying to achieve.


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    @techguy The philosophy for wide-spread adoption is to not create any additional tables, and use meta whenever possible. This way you can rely on the internal functions of WordPress and BuddyPress to get and set that data, and you don’t have an upset site admin that needs to figure out where to put that table, how to cache it, how to serve it across multiple servers, etc…

    I also think it depends on the scope that you need to achieve. The Groups API works really well for just about anything that you would want to plug into the groups component, but at the same time there can also be a need for totally 100% custom jobs where even the built in functionality doesn’t work for your application, in which case a totally custom theme might be in order.

    All in all, I usually start with a custom plugin, that relies on the Groups API and group meta, and only use wp_sitemeta/wp_options if it’s a blanket default setting for all groups that can be changed by the site administrator.


    techguy
    Participant

    @crashutah

    Thanks for the information and explanation. Little by little I’m figuring out all the various options for customizing and extending BP. The great part is that there are lots of options.

    Do you know of any existing plugins that use the Groups API really well that I could look at for an example?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Extending Groups’ is closed to new replies.
Skip to toolbar