[buddypress-dev] modifications to bp-xprofile-templatetags.php

Andy Peatling andypeatling at automattic.com
Tue Jun 3 21:00:10 GMT 2008


On 27-May-08, at 9:04 PM, David J. Bisset wrote:

> Andy,
>
> I am trying to place specific information in specific places on my  
> template, but I didn't see an easy way to do it in the files. Example:
>
> <?php if ( group_has_fields() ) : ?>
> <?php while ( profile_fields() ) : the_profile_field(); ?>
> <?php if ( the_profile_field_name(true) == "Zip Code" ) : ?>
> <?php $zipCode = the_profile_field_value(true); ?>
> <?php endif; ?>
> <?php endwhile; ?>
> <?php endif; ?>
>
> I'm realizing now that this probably isn't the best way, so perhaps  
> you can show me the alternate?
>

I'm not sure there is a really easy way of doing this right now. The  
best way would be to create a function that takes in the field name as  
a parameter, then returns the value. That way you don't have to loop  
through everything just to find one value.

Andy

---------
Andy Peatling | Social Engineer | Automattic
http://andyinlife.com





More information about the buddypress-dev mailing list