bp_media_activity_save_gif_data( $activity )

Save gif data into activity meta key “_gif_attachment_id”

Description

Parameters

$activity

(Required)

Source

File: bp-media/bp-media-filters.php

function bp_media_activity_save_gif_data( $activity ) {

	if ( empty( $_POST['gif_data'] ) ) {
		return;
	}

	$gif_data =  $_POST['gif_data'];

	$still = bp_media_sideload_attachment( $gif_data['images']['480w_still']['url'] );
	$mp4 = bp_media_sideload_attachment( $gif_data['images']['original_mp4']['mp4'] );

	bp_activity_update_meta( $activity->id, '_gif_data', [
		'still' => $still,
		'mp4'   => $mp4,
	] );

	bp_activity_update_meta( $activity->id, '_gif_raw_data', $gif_data );
}

Changelog

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.