Purely Genius Way to Add Custom Profile Fields

Everyone has been asking about how to add custom fields for profiles. I too have wanted to do some customization to the profile, but without having to modify the core or profile source. Here is what I did to make a wicked simple mp3 player for the site I’m working on.

Step 1, Create a group, and a few sub fields for that group. For this example it was “Audio Details”, then I created a sub field “favorite Band of All time” and “Favorite Album of All Time”.

Step 3. Because I didn’t want it to replace every profile field, and this is the magic, I wrote a 2nd filter, which looks at the group name, and turns on and off filtering, for different purposes. Since I didn’t want url linking filtering adding to the field value, I turned that off, and turned on my mp3 widget filter. The next time the group runs, it turns back on the default filters and removes my mp3 filters.

This is a good solution (or hack) for when this has to be in the profile page. I can easily see this expanding into it’s own page for bigger sites. And I forgot about the filter hint from Andy. Good job.

I have started working on other versions, which could show netflix queue, hulu queue, or youtube streams. They all revolve around similar ideas.

This method has sort of been replaced by custom boxes, but due to the profile loop showing all fields, there is no easy way to get the users “favorite song, artist, band”, without it also displaying inside of the loop

It did the same thing to me.I fixed that by deleting bp-music.php and puting the code directly in bp-xprofile-filters.php.I don’t know if it’s a good issue but it’s currently working, thanks Fishbowl81.

Hello, Im pretty new to php and i pasted the custom profile code into my bp-xprofile-filters.php file, and it killed my site, i just get the error: Parse error: syntax error, unexpected ‘”‘, expecting ‘)’ in /home/richied/plainprofile.com/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-filters.php on line 158

i tried deleting and re-installing buddypress but im still getting it! site url is: plainprofile.com

It’s a syntax error so you need to examine the line it’s referring to and check and correct the syntax php met an unexpected double quote mark and seems to be suggesting there ought to have been an ) closing parentheses. this is an extremely old post you have dragged up and I would expect this plugin/code to necessarily work given the version updates to BP since this was written.

btw editing core files in this manner is not advised really, if it’s a filter it ought to be written to a functions.php file living in a child theme

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

The topic ‘Purely Genius Way to Add Custom Profile Fields’ is closed to new replies.