[buddypress-trac] [BuddyPress Trac] #6772: BuddyPress Embeds for activity, user profiles, groups
buddypress-trac
noreply at wordpress.org
Fri Dec 18 20:09:45 UTC 2015
#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):
Oops! Sorry about `04.patch`, imath!
`05.patch` does the following:
- Fixes issues with embedding from `04.patch`.
- Adds a "Read More" link to the embed excerpt. I made a few tweaks to
`bp_activity_truncate_entry()` and `bp_create_excerpt()` as I was working
on this.
- The `BP_oEmbed_Component` class now supports registering your own oEmbed
endpoint args with the `set_route_args()` method. See how the
`BP_Activity_oEmbed_component` class registers the `'hide_media'`
parameter.
- Moved embed media block to a function and hooked to the new
`'bp_activity_embed_after_content'` action.
Regarding:
> Anyway i think i wouldn't try to embed an embed.
Twitter allows an embed within a embed:
`https://dev.twitter.com/cards/overview`
I also think it should be up to the BP site if they want to disable this
or not.
In `05.patch`, you can disable displaying embeds with this -
`remove_filter( 'bp_activity_embed_display_media', '__return_false' );`.
I also think it's useful for devs to ping our oEmbed endpoint to see if
they want to hide media or not.
`05.patch` registers `'hide_media'` as an oEmbed parameter and allows devs
that are pinging our oEmbed activity endpoint to set this parameter.
So if a dev does this request:
{{{
// Make sure the activity permalink is valid before doing this!
http://example.com/wp-
json/oembed/1.0/embed/activity?hide_media=1&url=http%3A%2F%2Fexample.com%2Fmembers%2FUSER%2Factivity%2F1%2F
}}}
The embedded item will not be shown.
This is similar to
[https://dev.twitter.com/rest/reference/get/statuses/oembed how Twitter's
oEmbed works].
Let me know what you think.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6772#comment:16>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list