bp_core_install_friends

Install database tables for the Notifications component.

Description

bp_core_install_friends(); 

Usage

  1. if ( !function_exists( 'bp_core_install_friends' ) ) { 
  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_friends(); 
  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_friends() { 
  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_friends ( 
  7. id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,  
  8. initiator_user_id bigint(20) NOT NULL,  
  9. friend_user_id bigint(20) NOT NULL,  
  10. is_confirmed bool DEFAULT 0,  
  11. is_limited bool DEFAULT 0,  
  12. date_created datetime NOT NULL,  
  13. KEY initiator_user_id (initiator_user_id),  
  14. KEY friend_user_id (friend_user_id) 
  15. ) {$charset_collate};"; 
  16.  
  17. dbDelta( $sql );