bp_core_install_blog_tracking

Install database tables for the Sites component.

Description

bp_core_install_blog_tracking(); 

Usage

  1. if ( !function_exists( 'bp_core_install_blog_tracking' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/admin/bp-core-admin-schema.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_core_install_blog_tracking(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/bp-core/admin/bp-core-admin-schema.php  
  1. function bp_core_install_blog_tracking() { 
  2. $sql = array(); 
  3. $charset_collate = $GLOBALS['wpdb']->get_charset_collate(); 
  4. $bp_prefix = bp_core_get_table_prefix(); 
  5.  
  6. $sql[] = "CREATE TABLE {$bp_prefix}bp_user_blogs ( 
  7. id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,  
  8. user_id bigint(20) NOT NULL,  
  9. blog_id bigint(20) NOT NULL,  
  10. KEY user_id (user_id),  
  11. KEY blog_id (blog_id) 
  12. ) {$charset_collate};"; 
  13.  
  14. $sql[] = "CREATE TABLE {$bp_prefix}bp_user_blogs_blogmeta ( 
  15. id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,  
  16. blog_id bigint(20) NOT NULL,  
  17. meta_key varchar(255) DEFAULT NULL,  
  18. meta_value longtext DEFAULT NULL,  
  19. KEY blog_id (blog_id),  
  20. KEY meta_key (meta_key(191)) 
  21. ) {$charset_collate};"; 
  22.  
  23. dbDelta( $sql );