BP_Admin_Setting_Activity: settings_save ()
描述
源
文件:bp-core /管理/设置/ bp-admin-setting-activity.php
Public function settings_save() {parent::settings_save();英国石油美元= buddypress ();active_components =美元bp - > active_components;//激活博客组件的标志$is_blog_component_active = false;//获取所有活动的自定义post类型。$post_types = get_post_types(['public' => true]);foreach ($post_type as $cpt){//排除所有已经在BuddyPress活动支持的自定义post类型。If (in_array($cpt, ['forum', 'topic', 'reply', 'page', 'attachment', 'bp-group-type', 'bp-member-type']){继续;} $enable_blog_feeds = isset($_POST["bp-feed-custom-post-type-$cpt"]);If ($enable_blog_feeds) {$is_blog_component_active = true; } } if ( $is_blog_component_active ) { $active_components['blogs'] = '1'; } else { unset( $active_components['blogs'] ); } // Save settings and upgrade schema. require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); require_once( $bp->plugin_dir . '/bp-core/admin/bp-core-admin-schema.php' ); $bp->active_components = $active_components; bp_core_install( $bp->active_components ); bp_core_add_page_mappings( $bp->active_components ); bp_update_option( 'bp-active-components', $bp->active_components ); }