bp_activity_media_fix_data()

Fix to BuddyBoss media activity data

Description

Source

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

function bp_activity_media_fix_data() {

	$privacy  = array( 'public', 'loggedin', 'friends', 'onlyme', 'grouponly', 'media' );
	$meta_query = array(
		array(
			'relation' => 'OR',
			'key'      => 'bp_media_activity',
			'compare'  => 'EXISTS',
		)
	);

	$result = BP_Activity_Activity::get( array( 'per_page' => 10000, 'privacy' => $privacy, 'meta_query' => $meta_query, 'show_hidden' => true ) );

	if ( ! empty( $result['activities'] ) ) {
		foreach ( $result['activities'] as $activity ) {
			$activity = new BP_Activity_Activity( $activity->id );

			if ( ! empty( $activity ) ) {
				$activity->privacy = 'media';
				$activity->save();
			}
		}
	}
}

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.