Skip to:
Content
Pages
Categories
Search
Top
Bottom

Need to add two custom fields to the default group creation


  • BlinkyBill01
    Participant

    @blinkybill01

    Howdy,

    First off, really digging BuddyPress. it’s going to help me a lot with my fansite, but I’m trying to figure out how to add two custom fields to the default group creation.

    Since it’s going to be a fansite, the two custom fields I need added are:

    URL field – So that the group creator can link to an external website
    Required Check Box – so they can select a type of group they are creating (ie. Football, Baseball, etc.)

    Right now, the only fields used for group creation are “Group Name” and “Group Description”. Is it even possible to add more fields for them to fill out before the group can be created?

    I have no idea where to start. Not sure what it entails but not really looking to add another plugin to the site.

    Any help would be appreciated. Thanks!

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

  • modemlooper
    Moderator

    @modemlooper

    https://github.com/modemlooper/buddypress-group-fields

    Example plugin, you’ll need to edit form inputs to customize it.


    @mikey3d
    Participant

    @mikey3d

    @modemlooper

    I just try your plugin buddypress group fields and I get an error:

    `Warning: extract() [function.extract]: First argument should be an array in /home/user/apps/wordpress/wp-content/plugins/buddypress-group-fields/buddypress-group-fields.php on line 9`

    Yes, it shows a Restaurant Description, Restaurant Price etc. I have the latest WordPress and BuddyPress.

    Thanks, Mikey3D


    modemlooper
    Moderator

    @modemlooper

    It’s really a working plugin, its an example to show how to add extra fields


    BlinkyBill01
    Participant

    @blinkybill01

    Ok, I tested this out and it looks like it’s going in the right direction.

    Howeverr, I am also getting the same error that Mikey3D got. Same error about an array on line 9.

    Also, the information from the custom fields is not visible on the groups page. The only info showing is the default Group Name and Group Description. None of the restaraunt info (as I’m testing right from your code) is showing up anywhere except in that Groups Admin.


    modemlooper
    Moderator

    @modemlooper

    I meant to say it’s not a 100% working plugin. I pointed you to it as an example of how to add fields. The fields there are just example and should be removed and replaced with something that works. I plan when I have time to make this plugin work.


    CJ Kruger
    Participant

    @cj-kruger

    Ive written one, just cleaning up the code – will be up later today ;)

    As for the “Required Check Box”, try out BP Group tags – the new category feature should suit your needs


    CJ Kruger
    Participant

    @cj-kruger

    @BlinkyBill01 and @mikey3d

    Here’s the plugin, im open to suggestions and improvements.

    `Adds two additional/optional fields to your BuddyPress groups – let groups link to an external website and extra field you may define.`

    Buddypress group plus

    Its the initial release, still have to clean up a few things but it works :)


    BlinkyBill01
    Participant

    @blinkybill01

    Excellent plugin CJ! This is exactly what I’ve been looking for.

    I looked into the BP Group tags, and while it’s good, it’s not exactly what I’m looking for. One BP site I’m working on is a videogame fansite. Each member can create a group based on the game they play. But, like most game, there are other “mini-games” inside the main game.

    I was looking for a way to allow people to use a required checkbox with a bunch of options so they can select the type of mini-game their group is about. That way, when someone searches that exact mini-game, they get a listing of all the groups that deal with that type of minigame.

    Sadly, with the group tags, it leaves the tags to be placed in the hands of the user. This can lead to people typing in a tag that doesn’t have anything to do with their group, a misspelled tags, etc.

    I figured it would be best if there was either a drop down or checkbox selection so that people could choose what category their group best fits into, It would also save time not having to search tags for profanity or inappropriate content.

    But I can really see this plugin being able to give more options to the users. Is it possible to add many different types of forms to this plugin (checkbox, dropdown, etc) so that Admins can activate/disable them in the same way URL and Group field is?

    Once again, great plugin!


    BlinkyBill01
    Participant

    @blinkybill01

    Wow… please disregard the comments I made about BP Group Tags. Apparently I downloaded the wrong plugin thinking it was BP Group Tags. That’s exactly what I was looking for. In addition to your plugin, CJ, I have exactly what I’ve been looking for.

    Kudos! XD


    CJ Kruger
    Participant

    @cj-kruger

    @boonebgorges I used your $group_details_save function from the plugin above – line 56

    I only used the $plain_fields, and can’t figure out how to check if `$success = true`, to be used in the group extension api:

    ` if ( !$success )
    bp_core_add_message( __( ‘There was an error saving, please try again’, ‘buddypress’ ), ‘error’ );
    else
    bp_core_add_message( __( ‘Settings saved successfully’, ‘buddypress’ ) );`

    For now I’m just skipping it so I can continue work by using `$success = true;`.

    If you have a some spare time and wouldn’t mind taking a look, here is my version of the Group Extension – Past bin

    Line 68 is where Im using `$success = true;`, just above the `!$success check`
    Line 114 is my version of function `group_details_save`.

    Ps: sorry for the long read :(

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Need to add two custom fields to the default group creation’ is closed to new replies.
Skip to toolbar