Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/21/2014 04:14:52 PM (11 years ago)
Author:
johnjamesjacoby
Message:

Signups: Introduce functions for upgrading the global wp_signups table if an old version exists. This happens primarily on singlesite installations where third party plugins may have previously created the sign-ups table without keeping it updated.

  • Bumps the DB version number to 8300.
  • Moves functions for table creation and upgrade into the admin schema file.
  • Moves sign-ups table creation out of activation process, and into the database upgrade process.
  • No not rely on dbDelta() for these specific database upgrades (inspired by [WP25179])

See #5563, #WP27855. (trunk)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/admin/bp-core-functions.php

    r8272 r8302  
    277277            'name' => __( 'Register', 'buddypress' )
    278278        );
    279 
    280         bp_core_maybe_install_signups();
    281279    }
    282280
     
    795793
    796794/**
    797  * Check if the signups table needs to be created.
    798  *
    799  * @since BuddyPress (2.0.0)
    800  *
    801  * @global $wpdb
    802  */
    803 function bp_core_maybe_install_signups() {
    804     global $wpdb;
    805 
    806     // Multisite installations already have the signups table.
    807     if ( ! empty( $wpdb->signups ) ) {
    808         return;
    809     }
    810 
    811     $bp_signups = bp_core_get_table_prefix() . 'signups';
    812 
    813     // Check for the table
    814     $suppress = $wpdb->suppress_errors();
    815     $table_exists = $wpdb->get_results( "DESCRIBE {$bp_signups};" );
    816     $wpdb->suppress_errors( $suppress );
    817 
    818     // Bail if the table exists
    819     if ( ! empty( $table_exists ) ) {
    820         return;
    821     }
    822 
    823     // Signups is not there and we need it so let's create it
    824     require_once( buddypress()->plugin_dir . '/bp-core/admin/bp-core-schema.php' );
    825 
    826     bp_core_install_signups();
    827 }
    828 
    829 /**
    830795 * Add "Mark as Spam/Ham" button to user row actions.
    831796 *
Note: See TracChangeset for help on using the changeset viewer.