bp_admin_forum_repair_tools_wrapper_function ()
包装器的功能来处理修复论坛的所有动作。
描述
源
文件:bp-forums / admin / tools.php
function bp_admin_forum_repair_tools_wrapper_function() {$type = isset($_POST['type']) ?$ _POST['类型']:”;$response = array('feedback' => sprintf('', esc_html__('执行此操作有问题。请再试一次。', 'buddyboss')),);//如果不是POST操作,则保释。如果(!Bp_is_post_request ()) {wp_send_json_error($response);} if(空($_POST['nonce'])) {wp_send_json_error($response);} //使用默认nonce $nonce = $_POST['nonce']; $check = 'bbpress-do-counts'; // Nonce check! if ( empty( $nonce ) || ! wp_verify_nonce( $nonce, $check ) ) { wp_send_json_error( $response ); } if( is_multisite() && bp_is_network_activated() ){ switch_to_blog( $_POST['site_id'] ); } if ( 'bbp-sync-topic-meta' === $type ) { $status = bbp_admin_repair_topic_meta(); } elseif ( 'bbp-sync-forum-meta' === $type ) { $status = bbp_admin_repair_forum_meta(); } elseif ( 'bbp-sync-forum-visibility' === $type ) { $status = bbp_admin_repair_forum_visibility(); } elseif ( 'bbp-sync-all-topics-forums' === $type ) { $status = bbp_admin_repair_freshness(); } elseif ( 'bbp-sync-all-topics-sticky' === $type ) { $status = bbp_admin_repair_sticky(); } elseif ( 'bbp-sync-all-reply-positions' === $type ) { $status = bbp_admin_repair_reply_menu_order(); } elseif ( 'bbp-group-forums' === $type ) { $status = bbp_admin_repair_group_forum_relationship(); } elseif ( 'bbp-forum-topics' === $type ) { $status = bbp_admin_repair_forum_topic_count(); } elseif ( 'bbp-forum-replies' === $type ) { $status = bbp_admin_repair_forum_reply_count(); } elseif ( 'bbp-topic-replies' === $type ) { $status = bbp_admin_repair_topic_reply_count(); } elseif ( 'bbp-topic-members' === $type ) { $status = bbp_admin_repair_topic_voice_count(); } elseif ( 'bbp-topic-hidden-replies' === $type ) { $status = bbp_admin_repair_topic_hidden_reply_count(); } elseif ( 'bbp-user-topics' === $type ) { $status = bbp_admin_repair_user_topic_count(); } elseif ( 'bbp-user-replies' === $type ) { $status = bbp_admin_repair_user_reply_count(); } elseif ( 'bbp-user-favorites' === $type ) { $status = bbp_admin_repair_user_favorites(); } elseif ( 'bbp-user-topic-subscriptions' === $type ) { $status = bbp_admin_repair_user_topic_subscriptions(); } elseif ( 'bbp-user-forum-subscriptions' === $type ) { $status = bbp_admin_repair_user_forum_subscriptions(); } elseif ( 'bbp-user-role-map' === $type ) { $status = bbp_admin_repair_user_roles(); } elseif ( 'bbp-wp-role-restore' === $type ) { $status = bbp_restore_caps_from_wp_roles(); } if( is_multisite() && bp_is_network_activated() ) { restore_current_blog(); } if ( 0 === $status['status'] ) { wp_send_json_error( $status ); } else { wp_send_json_success( $status ); } }
更新日志
版本 | 描述 |
---|---|
BuddyBoss 1.1.8 | 介绍了。 |