bp_core_install_signups

Install the signups table.

Description

bp_core_install_signups(); 

Usage

  1. if ( !function_exists( 'bp_core_install_signups' ) ) { 
  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_signups(); 
  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_signups() { 
  2. global $wpdb; 
  3.  
  4. // Signups is not there and we need it so let's create it. 
  5. require_once(buddypress)->plugin_dir . '/bp-core/admin/bp-core-admin-schema.php' ); 
  6. require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 
  7.  
  8. // Never use bp_core_get_table_prefix() for any global users tables. 
  9. $wpdb->signups = $wpdb->base_prefix . 'signups'; 
  10.  
  11. // Use WP's core CREATE TABLE query. 
  12. $create_queries = wp_get_db_schema( 'ms_global' ); 
  13. if ( ! is_array( $create_queries ) ) { 
  14. $create_queries = explode( ';', $create_queries ); 
  15. $create_queries = array_filter( $create_queries ); 
  16.  
  17. // Filter out all the queries except wp_signups. 
  18. foreach ( $create_queries as $key => $query ) { 
  19. if ( preg_match( "|CREATE TABLE ([^ ]*)|", $query, $matches ) ) { 
  20. if ( trim( $matches[1], '`' ) !== $wpdb->signups ) { 
  21. unset( $create_queries[ $key ] ); 
  22.  
  23. // Run WordPress's database upgrader. 
  24. if ( ! empty( $create_queries ) ) { 
  25. dbDelta( $create_queries );