Skip to:

How to create more fields in a group?

  • Profile photo of ericooliveira


    I would like to know if there a plugin or other way to create more fields for users fill when he are creating a group. Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Profile photo of crazywhistlepig


    As would I. I am using a buddypress installation to manage organizations as groups, and need to add the org’s address, and other info. Is this possible?


    Profile photo of r-a-y


    No plugin exists for this at the moment.

    This has to be manually coded. If you’re a plugin developer, check out this codex article:

    And also check out the groupmeta functions in /bp-groups.php.

    There are a few threads about this on I’d suggest doing a search on Google.

    An example can be found here:

    Profile photo of 4ella


    I would like to know that too , it is strange that nobody didn’t create it till now , because many times the groups are companies , and those have addresses so it should be nice to have all location info of any group on some group “map- location-contact” page .

    Profile photo of nit3watch


    I put this together some time ago though should still work. change gcode and dress code to what you would like. Save it as what ever you would like, with a php extension and place it in your plugins. Active and gl :P I also greated some group map plugin some time ago thats floating around on the forums.. you would have to search or wait for gpress.

    Plugin Name: BuddyPress Group Dress Code
    Plugin URI:
    Description: This plugin adds an additional field to group creation for a dress code
    Version: 1.0
    Revision Date: June 25, 2010
    License: GNU General Public License 2.0 (GPL)
    Author: Charl Kruger
    Author URI:

    /* Show group dresscode number in group header */
    $gdcode_show_dresscode_in_header = true ;

    /* – HERE BEGINS THE CODE – */

    // create the form to add the field
    function gdcode_add_dresscode_form() {

    <input type="text" name="group-dresscode" id="group-dresscode" value="” />


    add_action( ‘groups_custom_group_fields_editable’, ‘gdcode_add_dresscode_form’ );

    // Save the dresscode number in the group meta – perhaps use serialize() and maybe_unserialize()
    function gdcode_save_dresscode( $group_id ) {
    global $bp;

    $id = $bp->groups->new_group_id;
    $id = $group_id;

    if ( $_POST )
    groups_update_groupmeta( $id, ‘gdcode_group_dresscode’, $_POST );

    // Get or return the dresscode number
    function gdcode_group_dresscode() {
    echo gdcode_get_group_dresscode();
    function gdcode_get_group_dresscode( $group = false ) {
    global $groups_template;
    if ( !$group )
    $group =& $groups_template->group;
    $group_dresscode = groups_get_groupmeta( $group->id, ‘gdcode_group_dresscode’ );
    $group_dresscode = stripcslashes( $group_dresscode );
    return apply_filters( ‘gdcode_get_group_dresscode’, $group_dresscode );

    // show dresscode number in group header
    function gdcode_show_dresscode_in_header( $description ) {
    global $gdcode_show_dresscode_in_header;
    if ( gdcode_get_group_dresscode() && $gdcode_show_dresscode_in_header ) {
    $description .= ‘

    ‘. __(‘Dress code’, ‘gdcode’).’: 

    return $description;
    add_filter( ‘bp_get_group_description’, ‘gdcode_show_dresscode_in_header’ );

    // show number for an individual group
    function gdcode_make_dresscode_for_group() {
    global $bp, $wpdb, $gdcode_args;

    $group_dresscode = gdcode_get_group_dresscode();
    $group_dresscode = ‘



    return $group_dresscode;

    add_action( ‘groups_create_group_step_save_group-details’, ‘gdcode_save_dresscode’ );
    add_action( ‘groups_details_updated’, ‘gdcode_save_dresscode’ );

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to create more fields in a group?’ is closed to new replies.
Skip to toolbar