bp_core_update_group_fields_id_in_db ()
在BuddyPress更新
描述
源
文件:bp-core /兼容性/ bp-incompatible-plugins-helper.php
函数bp_core_update_group_fields_id_in_db() {if (is_multisite()) {global $wpdb;$ bp_prefix = bp_core_get_table_prefix ();$table_name = $bp_prefix。“bp_xprofile_fields”;If (empty(bp_xprofile_firstname_field_id(0, false)){//第一个名字字段更新$firstname = bp_get_option('bp-xprofile-firstname-field-name');$results = $wpdb->get_results("SELECT id FROM {$table_name} WHERE name = '{$firstname}'");$ count = 0;如果(!$result = absint($result->id); / / $result = >idIf (empty($count) && ! empty( $id ) ) { add_site_option( 'bp-xprofile-firstname-field-id', $id ); $count ++; } else { $wpdb->delete( $table_name, array( 'id' => $id ) ); } } } } if ( empty( bp_xprofile_lastname_field_id( 0, false ) ) ) { //last name fields update $lastname = bp_get_option( 'bp-xprofile-lastname-field-name' ); $results = $wpdb->get_results( "SELECT id FROM {$bp_prefix}bp_xprofile_fields WHERE name = '{$lastname}'" ); $count = 0; if ( ! empty( $results ) ) { foreach ( $results as $result ) { $id = absint( $result->id ); if ( empty( $count ) && ! empty( $id ) ) { add_site_option( 'bp-xprofile-lastname-field-id', $id ); $count ++; } else { $wpdb->delete( $table_name, array( 'id' => $id ) ); } } } } if ( empty( bp_xprofile_nickname_field_id( true, false ) ) ) { //nick name fields update $nickname = bp_get_option( 'bp-xprofile-nickname-field-name' ); $results = $wpdb->get_results( "SELECT id FROM {$bp_prefix}bp_xprofile_fields WHERE name = '{$nickname}'" ); $count = 0; if ( ! empty( $results ) ) { foreach ( $results as $result ) { $id = absint( $result->id ); if ( empty( $count ) && ! empty( $id ) ) { add_site_option( 'bp-xprofile-nickname-field-id', $id ); $count ++; } else { $wpdb->delete( $table_name, array( 'id' => $id ) ); } } } } add_site_option( 'bp-xprofile-field-ids-updated', 1 ); } }
更新日志
版本 | 描述 |
---|---|
BuddyBoss 1.0.9 | 介绍了。 |