bp_core_install_media()

Install database tables for Media component.

Description

Source

File: bp-core/admin/bp-core-admin-schema.php

677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
function bp_core_install_media() {
    $sql             = array();
    $charset_collate = $GLOBALS['wpdb']->get_charset_collate();
    $bp_prefix       = bp_core_get_table_prefix();
 
    $sql[] = "CREATE TABLE {$bp_prefix}bp_media_albums (
       id bigint(20) NOT NULL AUTO_INCREMENT,
       user_id bigint(20) NOT NULL,
       group_id bigint(20) NULL,
       date_created datetime NULL DEFAULT '0000-00-00 00:00:00',
       title text NOT NULL,
       privacy varchar(50) NULL DEFAULT 'public',
       PRIMARY KEY  (id)
   ) {$charset_collate};";
 
    $sql[] = "CREATE TABLE {$bp_prefix}bp_media (
        id bigint(20) NOT NULL AUTO_INCREMENT ,
        blog_id bigint(20) NULL DEFAULT NULL,
        attachment_id bigint(20) NOT NULL ,
        user_id bigint(20) NOT NULL,
        title text,
        album_id bigint(20),
        group_id bigint(20),
        activity_id bigint(20) NULL DEFAULT NULL ,
        privacy varchar(50) NULL DEFAULT 'public',
        menu_order bigint(20) NULL DEFAULT 0 ,
        date_created datetime DEFAULT '0000-00-00 00:00:00',
        PRIMARY KEY  (id),
        KEY attachment_id (attachment_id),
        KEY user_id (user_id),
        KEY album_id (album_id),
        KEY media_author_id (album_id,user_id),
        KEY activity_id (activity_id)
    ) {$charset_collate};";
 
    dbDelta( $sql );
}

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.