bp_admin_tools_default_data_save ()
当按下虚拟数据添加按钮时,保存虚拟数据值
描述
源
文件:bp-core / bp-core-tools-default-data.php
函数bp_admin_tools_default_data_save() {if (!空($ _POST [' bp-admin-clear '])) {bp_dd_clear_db ();Echo ''。__(“所有东西都被删除了。’、‘buddyboss’)。' < / p > < / div >”;} if (isset($_POST['bp-admin-submit']){//查看我们刚刚导入的内容。$ =进口数组();//在我们做任何事情之前检查nonce。check_admin_referer(“bp-admin-tools-default-data”);//导入用户if (isset($_POST['bp'][' Import -users']) && ! bp_dd_is_imported( 'users', 'users' ) ) { bp_dd_delete_dummy_members_related_data(); bp_delete_option( 'bp_dd_import_users' ); $users = bp_dd_import_users(); $imported['users'] = sprintf( __( '%s new members', 'buddyboss' ), number_format_i18n( count( $users ) ) ); bp_dd_update_import( 'users', 'users' ); } if ( isset( $_POST['bp']['import-profile'] ) && ! bp_dd_is_imported( 'users', 'xprofile' ) ) { $profile = bp_dd_import_users_profile(); $imported['profile'] = sprintf( __( '%s profile field entries', 'buddyboss' ), number_format_i18n( $profile ) ); bp_dd_update_import( 'users', 'xprofile' ); } if ( isset( $_POST['bp']['import-friends'] ) && ! bp_dd_is_imported( 'users', 'friends' ) ) { $friends = bp_dd_import_users_friends(); $imported['friends'] = sprintf( __( '%s member connections', 'buddyboss' ), number_format_i18n( $friends ) ); bp_dd_update_import( 'users', 'friends' ); } if ( isset( $_POST['bp']['import-messages'] ) && ! bp_dd_is_imported( 'users', 'messages' ) ) { $messages = bp_dd_import_users_messages(); $imported['messages'] = sprintf( __( '%s private messages', 'buddyboss' ), number_format_i18n( count( $messages ) ) ); bp_dd_update_import( 'users', 'messages' ); } if ( isset( $_POST['bp']['import-activity'] ) && ! bp_dd_is_imported( 'users', 'activity' ) ) { $activity = bp_dd_import_users_activity(); $imported['activity'] = sprintf( __( '%s personal activity items', 'buddyboss' ), number_format_i18n( $activity ) ); bp_dd_update_import( 'users', 'activity' ); } // Import groups if ( isset( $_POST['bp']['import-groups'] ) && ! bp_dd_is_imported( 'groups', 'groups' ) ) { $groups = bp_dd_import_groups(); $imported['groups'] = sprintf( __( '%s new social groups', 'buddyboss' ), number_format_i18n( count( $groups ) ) ); bp_dd_update_import( 'groups', 'groups' ); } if ( isset( $_POST['bp']['import-g-members'] ) && ! bp_dd_is_imported( 'groups', 'members' ) ) { $g_members = bp_dd_import_groups_members(); $imported['g_members'] = sprintf( __( '%s group members (1 user can be in several groups)', 'buddyboss' ), number_format_i18n( count( $g_members ) ) ); bp_dd_update_import( 'groups', 'members' ); } if ( isset( $_POST['bp']['import-g-activity'] ) && ! bp_dd_is_imported( 'groups', 'activity' ) ) { $g_activity = bp_dd_import_groups_activity(); $imported['g_activity'] = sprintf( __( '%s group activity items', 'buddyboss' ), number_format_i18n( $g_activity ) ); bp_dd_update_import( 'groups', 'activity' ); } if ( isset( $_POST['bp']['import-forums'] ) && ! bp_dd_is_imported( 'forums', 'forums' ) ) { $forums = bp_dd_import_forums(); $imported['forums'] = sprintf( __( '%s forums activity items', 'buddyboss' ), count( $forums ) ); bp_dd_update_import( 'forums', 'forums' ); } if ( isset( $_POST['bp']['import-f-topics'] ) && ! bp_dd_is_imported( 'forums', 'topics' ) ) { $topics = bp_dd_import_forums_topics(); $imported['g_topics'] = sprintf( __( '%s discussion activity items', 'buddyboss' ), count( $topics ) ); bp_dd_update_import( 'forums', 'topics' ); } if ( isset( $_POST['bp']['import-f-replies'] ) && ! bp_dd_is_imported( 'forums', 'replies' ) ) { $topics = bp_dd_import_forums_topics_replies(); $imported['g_replies'] = sprintf( __( '%s reply activity items', 'buddyboss' ), count( $topics ) ); bp_dd_update_import( 'forums', 'replies' ); } if ( isset( $_POST['bp']['import-g-forums'] ) && ! bp_dd_is_imported( 'groups', 'forums' ) ) { $groupsforums = bp_dd_import_forums_in_groups(); $imported['g_forums'] = sprintf( __( 'In %s group forums, discussions and replies were added', 'buddyboss' ), count( $groupsforums ) ); bp_dd_update_import( 'groups', 'forums' ); } ?>
0 ) { echo ':
'; } ?>
- '; echo implode( '
- ', $imported ); echo '
问题吗?