bp_admin_invitations_table ()

如果邀请数据库表不存在,则创建它。

描述

如果需要,迁移未完成的组邀请。

返回

(数组)

文件:bp-core / admin / bp-core-admin-tools.php

函数bp_admin_invitations_table(){全局$wpdb;require_once (ABSPATH。“wp-admin /包括/ upgrade.php ');require_once (buddypress () - > plugin_dir。' / bp-core / admin / bp-core-admin-schema.php ');/*翻译器:%s:修复工具执行操作的结果*/ $statement = __('创建邀请数据库表,如果它不存在…% s”、“buddyboss”);$result = __('创建表失败!”、“buddyboss”);bp_core_install_invitations ();//检查邀请表是否存在 $table_name = BP_Invitation_Manager::get_table_name(); $query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $table_name ) ); if ( ! $wpdb->get_var( $query ) == $table_name ) { return array( 'status' => 2, 'message' => sprintf( $statement, $result ), ); } else { $result = __( 'Created invitations table!', 'buddyboss' ); } // Migrate group invitations if needed. if ( bp_is_active( 'groups' ) ) { $bp = buddypress(); /* translators: %s: the result of the action performed by the repair tool */ $migrate_statement = __( 'Migrating group invitations… %s', 'buddyboss' ); $migrate_result = __( 'Failed to migrate invitations!', 'buddyboss' ); bp_groups_migrate_invitations(); // Check that there are no outstanding group invites in the group_members table. $records = $wpdb->get_results( "SELECT id FROM {$bp->groups->table_name_members} WHERE is_confirmed = 0 AND is_banned = 0" ); if ( empty( $records ) ) { $migrate_result = __( 'Migrated invitations!', 'buddyboss' ); return array( 'status' => 0, 'message' => sprintf( $statement . ' ' . $migrate_statement, $result, $migrate_result ), ); } else { return array( 'status' => 2, 'message' => sprintf( $statement . ' ' . $migrate_statement, $result, $migrate_result ), ); } } // Return a "create-only" success message. return array( 'status' => 0, 'message' => sprintf( $statement, $result ), ); }

更新日志

更新日志
版本 描述
BuddyBoss 1.3.5 介绍了。

问题吗?

我们总是很乐意帮助您解决代码或其他问题!搜索我们的开发人员文档联络支持,或与我们联系销售团队