diff --git src/bp-core/admin/bp-core-admin-schema.php src/bp-core/admin/bp-core-admin-schema.php
index 02a410ba9..244d1a1f9 100644
|
|
function bp_core_install_extended_profiles() { |
382 | 382 | |
383 | 383 | if ( ! $wpdb->get_var( "SELECT id FROM {$bp_prefix}bp_xprofile_fields WHERE id = 1" ) ) { |
384 | 384 | $insert_sql[] = "INSERT INTO {$bp_prefix}bp_xprofile_fields ( group_id, parent_id, type, name, description, is_required, can_delete ) VALUES ( 1, 0, 'textbox', " . $wpdb->prepare( '%s', stripslashes( bp_get_option( 'bp-xprofile-fullname-field-name' ) ) ) . ", '', 1, 0 );"; |
| 385 | |
| 386 | // Make sure the custom visibility is disabled for the default field. |
| 387 | if ( ! $wpdb->get_var( "SELECT id FROM {$bp_prefix}bp_xprofile_meta WHERE id = 1" ) ) { |
| 388 | $insert_sql[] = "INSERT INTO {$bp_prefix}bp_xprofile_meta ( object_id, object_type, meta_key, meta_value ) VALUES ( 1, 'field', 'allow_custom_visibility', 'disabled' );"; |
| 389 | } |
385 | 390 | } |
386 | 391 | |
387 | 392 | dbDelta( $insert_sql ); |
diff --git src/bp-core/bp-core-update.php src/bp-core/bp-core-update.php
index b006ff4d5..b2cc9761a 100644
|
|
function bp_version_updater() { |
268 | 268 | if ( $raw_db_version < 11105 ) { |
269 | 269 | bp_update_to_2_7(); |
270 | 270 | } |
| 271 | |
| 272 | // Version 5.0.0. |
| 273 | if ( $raw_db_version < 12385 ) { |
| 274 | bp_update_to_5_0(); |
| 275 | } |
271 | 276 | } |
272 | 277 | |
273 | 278 | /* All done! *************************************************************/ |
… |
… |
function bp_update_to_2_7() { |
542 | 547 | bp_add_option( '_bp_ignore_deprecated_code', false ); |
543 | 548 | } |
544 | 549 | |
| 550 | /** |
| 551 | * 5.0.0 update routine. |
| 552 | * |
| 553 | * - Make sure the custom visibility is disabled for the default profile field. |
| 554 | * |
| 555 | * @since 5.0.0 |
| 556 | */ |
| 557 | function bp_update_to_5_0() { |
| 558 | /** |
| 559 | * The xProfile component is active by default on new installs, even if it |
| 560 | * might be inactive during this update, we need to set the custom visibility |
| 561 | * for the default field, in case the Administrator decides to reactivate it. |
| 562 | */ |
| 563 | global $wpdb; |
| 564 | $bp_prefix = bp_core_get_table_prefix(); |
| 565 | $field_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp_prefix}bp_xprofile_fields WHERE name = %s", addslashes( bp_get_option( 'bp-xprofile-fullname-field-name' ) ) ) ); |
| 566 | |
| 567 | $wpdb->insert( |
| 568 | $bp_prefix . 'bp_xprofile_meta', |
| 569 | array( |
| 570 | 'object_id' => $field_id, |
| 571 | 'object_type' => 'field', |
| 572 | 'meta_key' => 'allow_custom_visibility', |
| 573 | 'meta_value' => 'disabled' |
| 574 | ), |
| 575 | array( |
| 576 | '%d', |
| 577 | '%s', |
| 578 | '%s', |
| 579 | '%s' |
| 580 | ) |
| 581 | ); |
| 582 | } |
| 583 | |
545 | 584 | /** |
546 | 585 | * Updates the component field for new_members type. |
547 | 586 | * |
diff --git src/class-buddypress.php src/class-buddypress.php
index 0789be65c..e6d8d609b 100644
|
|
class BuddyPress { |
304 | 304 | /** Versions **********************************************************/ |
305 | 305 | |
306 | 306 | $this->version = '5.0.0-alpha'; |
307 | | $this->db_version = 11105; |
| 307 | $this->db_version = 12385; |
308 | 308 | |
309 | 309 | /** Loading ***********************************************************/ |
310 | 310 | |