bp_media_activation_notice()

Hook to display admin notices when media component is active

Description

Source

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

1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
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.