[buddypress-trac] [BuddyPress Trac] #6603: Allow xprofile field values to be ran through oembed
buddypress-trac
noreply at wordpress.org
Fri Sep 14 21:29:01 UTC 2018
#6603: Allow xprofile field values to be ran through oembed
------------------------------+-----------------------
Reporter: DJPaul | Owner: (none)
Type: feature request | Status: reopened
Priority: normal | Milestone:
Component: Extended Profile | Version:
Severity: normal | Resolution:
Keywords: trac-tidy-2018 |
------------------------------+-----------------------
Changes (by wegosi):
* status: closed => reopened
* type: enhancement => feature request
* resolution: maybelater =>
Comment:
Hello.
This function will very useful.
Now I found this code
{{{
function bp_embed_in_profile() {
add_filter( 'bp_get_the_profile_field_value',
'bp_enable_embed_in_profile', 9, 3 );
}
add_action( 'bp_init', 'bp_embed_in_profile', 0 );
function bp_enable_embed_in_profile( $val, $type, $key ) {
$field = new BP_XProfile_Field( $key );
$field_name = $field->name;
$provider = array( 'youtube', 'vimeo', 'instagram', 'Відэа-
верыфікацыя', 'Відэа-прывітанне');
if( strtolower( $field_name ) == in_array( strtolower(
$field_name ) , $provider ) ) {
$val = strip_tags( $val );
return wp_oembed_get( $val, array( 'height' => 300 ) );
}
return $val;
}
}}}
It's working well for youtube and vimeo.
For stremable.com I need to add some CSS to remove frames.
https://prnt.sc/ktxjzx
{{{
/* Streamable frame size video embed in member profile */
.wp-embedded-content {
height: 45vmin;
}
}}}
But it's completely not working with COUBs, facebook, twitter, vk.com
videos.
It will be very useful to have this function in Buddypress.
Thank you
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6603#comment:11>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list