bp_media_forums_embed_gif( $content, $id )
Embed topic or reply gif in a post
Description
Parameters
- $content
-
(Required)
- $id
-
(Required)
Return
(string)
Source
File: bp-media/bp-media-filters.php
698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 | function bp_media_forums_embed_gif( $content , $id ) { $gif_data = get_post_meta( $id , '_gif_data' , true ); if ( empty ( $gif_data ) ) { return $content ; } $preview_url = wp_get_attachment_url( $gif_data [ 'still' ] ); $video_url = wp_get_attachment_url( $gif_data [ 'mp4' ] ); ob_start(); ?> <div class = "activity-attached-gif-container" > <div class = "gif-image-container" > <div class = "gif-player" > <video preload= "auto" playsinline poster= "<?php echo $preview_url ?>" loop muted playsinline> <source src= "<?php echo $video_url ?>" type= "video/mp4" > </video> <a href= "#" class = "gif-play-button" > <span class = "dashicons dashicons-video-alt3" ></span> </a> <span class = "gif-icon" ></span> </div> </div> </div> <?php $content .= ob_get_clean(); return $content ; } |
Changelog
Version | Description |
---|---|
BuddyBoss 1.0.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.