-1
如何将YouTube嵌入到Buddy Press用户配置文件的自定义字段中?如何在自定义字段中嵌入youtube好友按
如何将YouTube嵌入到Buddy Press用户配置文件的自定义字段中?如何在自定义字段中嵌入youtube好友按
请参考以下链接,希望这会帮助你,
http://snippetbarn.bp-fr.net/how-to-embed-a-video-on-profile/
function set_video_field($field_value) {
$bp_this_field_name = bp_get_the_profile_field_name();
// field name (case sensitive)
if($bp_this_field_name == 'Spotlight') {
$field_value = strip_tags($field_value);
// building the HTML and h/w of the iframe
$field_value = '<iframe width="420" height="315" src="http://www.youtube.com/embed/'.$field_value.'" frameborder="0" allowfullscreen></iframe>';
}
return $field_value;
}
add_filter('bp_get_the_profile_field_value','set_video_field');
这工作,谢谢! –
我添加了代码,因为链接将来可能会过期。 –