[Resolved] oEmbed in BP Profile
-
Hi there guys. I posted about this a few months ago, but the topic was closed, so i’ll have to create a new one.
I had gotten quite a few helpful responses but wasn’t able to get it working. Decided to take another look at it and i’ve gotten it sort-of working…
So…
In my plugins/bp-custom.php i’ve got the line
add_filter('bp_get_the_profile_field_value','wp_oembed_get');
this works, but only partially. It allows the video to be embeded into the Spotlight field; but at the same time strips away all the text from the other fields. So it seems that the filter is attempted to embed all the fields.
As a remedy, i’m working with this code that was suggested to me:
function bp_youtube_in_profile(){ add_filter('bp_get_the_profile_field_value','bp_enable_youtube_in_profile',9,3); } add_action('bp_init','bp_youtube_in_profile',0); function bp_enable_youtube_in_profile($val,$type,$key){ $field = new BP_XProfile_Field($key); $field_name = $field->name; $val = strip_tags($val); if(strtolower($field_name) == 'Spotlight'){ return wp_oembed_get($val,array('width'=>300)); } return $val; }
but this particular bit of code doesn’t want to work. Does the code look right to you guys?
Can someone explain to me how $val,$type, and $key in
function bp_enable_youtube_in_profile($val,$type,$key)
comes from?Thanks for all of yall’s support!
M
- The topic ‘[Resolved] oEmbed in BP Profile’ is closed to new replies.