bp_media_activation_notice()

Hook to display admin notices when media component is active

Description

Source

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

function bp_media_activation_notice() {
	global $wpdb;

	if ( ! empty( $_GET['page'] ) && 'bp-media-import' == $_GET['page'] ) {
		return;
	}

	$bp_media_import_status = get_option( 'bp_media_import_status' );

	if ( 'done' != $bp_media_import_status ) {

		$buddyboss_media_table        = $wpdb->prefix . 'buddyboss_media';
		$buddyboss_media_albums_table = $wpdb->prefix . 'buddyboss_media_albums';

		if ( ! empty( $wpdb->get_results( "SHOW TABLES LIKE '{$buddyboss_media_table}' ;" ) ) && ! empty( $wpdb->get_results( "SHOW TABLES LIKE '{$buddyboss_media_albums_table}' ;" ) ) ) {

			$admin_url = bp_get_admin_url( add_query_arg( array(
				'page' => 'bp-media-import',
				'tab'  => 'bp-media-import'
			), 'admin.php' ) );
			$notice    = sprintf( '%1$s <a href="%2$s">%3$s</a>',
				__( 'We have found some media uploaded from the <strong>BuddyBoss Media</strong></strong> plugin, which is not compatible with BuddyBoss Platform as it has its own media component. You should  import the media into BuddyBoss Platform, and then remove the BuddyBoss Media plugin if you are still using it.', 'buddyboss' ),
				esc_url( $admin_url ),
				__( 'Import Media', 'buddyboss' ) );

			bp_core_add_admin_notice( $notice );
		}
	}
}

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.