[buddypress-trac] [BuddyPress] #4496: public profile fields showing html code...
buddypress-trac at lists.automattic.com
buddypress-trac at lists.automattic.com
Fri Sep 7 17:23:46 UTC 2012
#4496: public profile fields showing html code...
--------------------------+------------------------------
Reporter: nitestop | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: XProfile | Version: 1.6
Severity: normal | Resolution:
Keywords: |
--------------------------+------------------------------
Comment (by SlothLoveChunk):
I know this is probably not a ton of help, but I can confirm this is
happening on my site as well (and yes, it started with 1.6). I am running
a custom theme however. This wasn't an issue prior to 1.6.
I'm not sure if it's related, but I will mention it because it happened at
the same time. Your older solutions for allowing certain BP profile
fields to be linked/unlinked does not work post 1.6. See
http://wordpress.org/extend/plugins/custom-profile-filters-for-buddypress/
and
http://openlab.citytech.cuny.edu/redmine/projects/openlab/repository/revisions/master/entry
/wp-content/plugins/custom-profile-filters-for-buddypress/custom-profile-
filters-for-buddypress-bp-functions.php
I specifically used the filter below to remove all HTML except for what
was explicitly defined in $allowedtags; however, this doesn't work anymore
(now I just see all HTML).
{{{
function cpfb_unlink_fields( $field_value ) {
$no_link_fields = array( // Enter the field ID of any field that you
want to appear as plain, non-clickable text. Don't forget to separate with
commas.
'Nickname' ,
'About Me' ,
'IM'
);
$allowedtags = '<p><ul><li><b><strong>';
if (checkUserRole('administrator'))
$allowedtags .= '<a>';
$bp_this_field_name = bp_get_the_profile_field_name();
if ( in_array( $bp_this_field_name, $no_link_fields ) )
$field_value = strip_tags( $field_value, $allowedtags );
return $field_value;
}
add_filter( 'bp_get_the_profile_field_value', 'cpfb_unlink_fields', 998, 1
);
}}}
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4496#comment:2>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list