Skip to:
Content

BuddyPress.org

Opened 4 years ago

Last modified 13 months ago

#6603 reopened feature request

Allow xprofile field values to be ran through oembed

Reported by: DJPaul Owned by:
Milestone: Awaiting Contributions Priority: normal
Severity: normal Version:
Component: Extended Profile Keywords: trac-tidy-2018
Cc: brajesh@…, danco38@…, espellcaste@…

Description

A suggestion that we if start adding advacned properties to xprofile fields (which I think we have started in some ticket, I can't find it), we should maybe have one to control whether the field value is run through oembed

Prompted by https://buddypress.org/support/topic/video-oembeds-in-profile-field/

Change History (13)

#1 @imath
4 years ago

+1000 I think it would be awesome!

Maybe this https://make.wordpress.org/core/2015/07/17/oembed-feature-plugin/ is worth looking at ;)

Looks like there might be some security considerations..

#2 @DJPaul
4 years ago

That's not the same thing. The idea behind this ticket is you could have a field "Favourite Youtube Video", and you paste in the URL to your video. In the template, we use the WP oembed to render the Youtube embed, not just the URL.

This wasn't meant to discuss making part of BP an oembed *provider*.

Last edited 4 years ago by DJPaul (previous) (diff)

#3 @imath
4 years ago

Ah ok, thanks for the precision :)

#4 @sbrajesh
4 years ago

This will be nice to have in core. The only concern is performance and layout. Are we going to cache the results? Using meta?
Also, how is that actually going to affect the profile layout?

#5 @sbrajesh
4 years ago

  • Cc brajesh@… added

#6 @danbp
4 years ago

  • Cc danco38@… added

I take the opportunity of this ticket to give my opinion.

I remember (not precisely, sorry) under 1.2/.13 aera, where @boone explained (imo wisely) on forum (or trac?) that he wouldn't develop to much around xprofile fields to create a professionnal form builder with dozen of options, to let this to be handled by more specific plugins, and only if the user want to use some.

Since, xprofile comes with a datebox, an url field, visibility settings, member types and is going slowly but surely to add an attachment feature. Anything is built-in today, fine, but not absolutely necessary for every BP usage. But if very strict field security bugs (because of all that mostly), they are for all user, what ever the usage. Gniiiiiiii ! This leads to an implicit imbalance in the component handling: for one xprofile is to weak, for another it's to strong.

Nothing is ideal and pro and contras is a never ending debate. I would just say that it is sometimes time to take a breath, to look back and to appreciate when to add something or when to just give a possibility to add something. Or to find the best moment to stop and to not go to far.

Sorry to say this (even with great decline), xprofile is on the opposite of that initial thought.

Adding embeds à la wordpress, by copy/pasting a wp allowed media url into a xprofile field (like used in text-editor) should be possible via the existing URL field. Under condition probably to remove/modify some existing restrictions/filters.

This is not a feature, not an enhancement, not a "Wow! great improvement" but only an internal modification to do. Or at least, an opportunity to not only think how to add new features, but also for some existing, or potentialy pre-existing, to get them easier/better. Before building a gas factory.

#7 @espellcaste
4 years ago

  • Cc espellcaste@… added

#8 @DJPaul
3 years ago

  • Type changed from idea to enhancement

#9 @DJPaul
20 months ago

  • Keywords trac-tidy-2018 added

We're closing this ticket because it has not received any contribution or comments for at least two years. We have decided that it is better to close tickets that are good ideas, which have not gotten (or are unlikely to get) contributions, rather than keep things open indefinitely. This will help us share a more realistic roadmap for BuddyPress with you.

Everyone very much appreciates the time and effort that you spent sharing your idea with us. On behalf of the entire BuddyPress team, thank you.

If you feel strongly that this enhancement should still be added to BuddyPress, and you are able to contribute effort towards it, we encourage you to re-open the ticket, or start a discussion about it in our Slack channel. Please consider that time has proven that good ideas without contributions do not get built.

For more information, see https://bpdevel.wordpress.com/2018/01/21/our-awaiting-contributions-milestone-contains/
or find us on Slack, in the #buddypress channel: https://make.wordpress.org/chat/

#10 @DJPaul
20 months ago

  • Milestone Awaiting Contributions deleted
  • Resolution set to maybelater
  • Status changed from new to closed

#11 @wegosi
13 months ago

  • Resolution maybelater deleted
  • Status changed from closed to reopened
  • Type changed from enhancement to feature request

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

#12 follow-up: @r-a-y
13 months ago

  • Milestone set to Awaiting Contributions

wegosi - Thanks, but that code snippet does not correctly cache oEmbed entries into the XProfile component's meta table.


There are some other considerations to take into account such as DJPaul's suggestion about only enabling oEmbed for certain XProfile fields and sbrajesh's concern about layout. Both are valid points.

#13 in reply to: ↑ 12 @wegosi
13 months ago

Replying to r-a-y:

wegosi - Thanks, but that code snippet does not correctly cache oEmbed entries into the XProfile component's meta table.


There are some other considerations to take into account such as DJPaul's suggestion about only enabling oEmbed for certain XProfile fields and sbrajesh's concern about layout. Both are valid points.

Thank you.
Sure. But I'm not a developer, unfortunately. I just can copy/paste the snippets into the code.
If you can help with, it will be great.

Note: See TracTickets for help on using tickets.