Changeset 10833 for trunk/src/bp-activity/bp-activity-functions.php
- Timestamp:
- 05/31/2016 06:53:00 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-functions.php
r10831 r10833 3390 3390 function bp_activity_embed() { 3391 3391 add_filter( 'embed_post_id', 'bp_get_activity_id' ); 3392 add_filter( 'oembed_dataparse', 'bp_activity_oembed_dataparse', 10, 2 ); 3392 3393 add_filter( 'bp_embed_get_cache', 'bp_embed_activity_cache', 10, 3 ); 3393 3394 add_action( 'bp_embed_update_cache', 'bp_embed_activity_save_cache', 10, 3 ); 3394 3395 } 3395 3396 add_action( 'activity_loop_start', 'bp_activity_embed' ); 3397 3398 /** 3399 * Cache full oEmbed response from oEmbed. 3400 * 3401 * @since 2.6.0 3402 * 3403 * @param string $retval Current oEmbed result. 3404 * @param object $data Full oEmbed response. 3405 * @param string $url URL used for the oEmbed request. 3406 * @return string 3407 */ 3408 function bp_activity_oembed_dataparse( $retval, $data ) { 3409 buddypress()->activity->oembed_response = $data; 3410 3411 return $retval; 3412 } 3396 3413 3397 3414 /** … … 3486 3503 function bp_embed_activity_save_cache( $cache, $cachekey, $id ) { 3487 3504 bp_activity_update_meta( $id, $cachekey, $cache ); 3505 3506 // Cache full oEmbed response. 3507 if ( true === isset( buddypress()->activity->oembed_response ) ) { 3508 $cachekey = str_replace( '_oembed', '_oembed_response', $cachekey ); 3509 bp_activity_update_meta( $id, $cachekey, buddypress()->activity->oembed_response ); 3510 } 3488 3511 } 3489 3512
Note: See TracChangeset
for help on using the changeset viewer.