[buddypress-trac] [BuddyPress Trac] #6772: BuddyPress Embeds for activity, user profiles, groups

buddypress-trac noreply at wordpress.org
Sun Feb 7 00:43:54 UTC 2016

#6772: BuddyPress Embeds for activity, user profiles, groups
 Reporter:  imath                   |       Owner:
     Type:  idea                    |      Status:  new
 Priority:  normal                  |   Milestone:  2.5
Component:  API                     |     Version:
 Severity:  normal                  |  Resolution:
 Keywords:  dev-feedback has-patch  |

Comment (by r-a-y):

 `06.patch` is refreshed and addresses the following:

 - Upgrades `fluidvids.js` to v2.4.1.  This fixes the majority of issues
 embedding video content from core WP oEmbed providers].  (I've listed
 fluidvids.js on the BP credits page.)
 - I tested each WP registered oEmbed provider and there are only some
 minor issues:
   - For Twitter and Soundcloud, the embeds require that our parent
 `<iframe>` has the `sandbox="allow-same-origin"` attribute.  I've added
 this attribute only when the oEmbed item is from Twitter or Soundcloud.
   - For Tumblr, the issue is their content loads dynamically.  WP's embed
 template tries to calculate the height of the IFRAME and
 embed.js#L55-L65 dynamically changes the height via JS].  I'm filtering
 WP's JS and making sure their JS fires with a delay of 550ms only for
 Tumblr embeds, so the iframe height is calculated after Tumblr loads their
 - Embeds that return images are now responsive (Flickr, Smugmug, etc.).
 - Embeds now have a max-width of 550px.
 - Ports over imath's suggestions - `bp_enqueue_embed_scripts()` and
 - Fixes previous grunt issue from `05.patch` with directly referencing
 `__( 'Embedded WordPress Post' )` by using `substr_replace()` to replace
 the string.
 - Temporarily moves custom embed CSS to inline CSS using
 `wp_add_inline_style()`.  We shouldn't be using an external stylesheet; WP
 uses inline CSS for their embed template as well.  However, WP's system
 uses grunt to include the CSS; this is not flexible for theme devs wanting
 to override the embed CSS.  What I would prefer to do is flesh out
 `BP_Legacy::locate_asset_in_stack()` and do something like what imath
 suggested -
 bp_locate_template_asset_uri()] - in a future BP version.  In the
 meantime, I think using `wp_add_inline_style()` is okay for the short-
 - Fixes some issues with `bp_activity_truncate_entry()` and
 `bp_create_excerpt()` when using `'html=false'`.


 For those that haven't been following along, these are the current issues
 for discussion:

 '''1) Should we show an embedded item (from YouTube, etc.) in our activity
 embed template?'''

 The current patch will show the first oEmbed item at the bottom of the
 template.  Only embeds that are
 registered WP oEmbed providers] will display.  This means that oEmbed-
 discovered items will not be embedded.

 I think this is fine as we are only displaying one embed item and that the
 oEmbed providers are limited to WP's registered oEmbed providers.

 '''2) Embed template resembles Twitter too much.'''

 I think this is a fair critique as I pretty much copied Twitter's UI as I
 was building this out.

 I understand that BP !== Twitter :)  So I'm definitely not stuck with the
 current design and would welcome contributions for something better here.

 '''3) Should the embed excerpt be plain-text or rich?'''

 I went back and forth about this numerous times in the previous patches.
 WP uses a plain-text excerpt for their embed template.  Current patch is
 plain-text, but allows links to be rendered.


 > It would be great to have functionality to appease both types of
 communities, if technically possible.

 I've tried to keep this in mind while building this out and I think I've
 accomplished that.

 I think we're going to have to bump this to 2.6.  Apologies for not
 getting this to a shippable version for 2.5.

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6772#comment:21>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list