Skip to:
Content
Pages
Categories
Search
Top
Bottom

Searching custom group fields

  • I’ve used the Group Extension API to store custom fields with my groups and these fields can be edited through admin through screens I’ve built. So that part’s done and working.

    So say I have a custom field called zip code. I want to have a custom form where you could enter a zip code and return all groups that have that zip code. But I want it to function the same way the Group search does on the default BuddyPress theme so it’s basically just altering the Group loop to output the list of groups (and it’s nice and AJAXy)

    I can build the form and front-end fine, but I’m not understanding where my backend code needs to go.

    So here are my questions:

    – Do I need to hook into groups_get_group to do this? I see in that function where I pass search terms, but I don’t know how to pass search terms if they’re custom database fields that I’ve created. So I’m assuming I need to write my own custom function to replace groups_get_group? I’m not sure where I need to start there.

    – I noticed the group search uses AJAX and calls wp-load.php and then somehow returns just the piece of HTML to replace the list of groups. Do I need to call a different action URL in my javascript?

    Basically, I think I need to write a hook into some function and I’m not quite sure where to start. I’m not afraid of writing code, and have written other small WP plugins, but I’ve never really done a hook like this before.

    Any help you could give me would be great. Thank you!

  • The topic ‘Searching custom group fields’ is closed to new replies.
Skip to toolbar