BP_Admin_Setting_tab

描述

文件:bp-core /类/ class-bp-admin-setting-tab.php

class BP_Admin_Setting_tab extends BP_Admin_Tab {public $global_tabs_var = 'bp_admin_setting_tabs';Public $menu_page = 'bp-settings';Public function settings_save() {parent::settings_save();$ this - > settings_save_lagecy ();}公共函数settings_saved() {bp_core_redirect(bp_core_admin_setting_url($this->tab_name, ['updated' => 'true']);} public function get_active_tab() {return bp_core_get_admin_active_tab();} public function is_tab_visible() {return $this->has_fields();}受保护函数settings_save_lagecy(){全局$wp_settings_fields;($wp_settings_fields[$this->tab_name])?(array) $wp_settings_fields[$this->tab_name]: []; $legacy_names = []; foreach( $fields as $section => $settings ) { foreach( $settings as $setting_name => $setting ) { $legacy_names[] = $setting_name; } } // Some legacy options are not registered with the Settings API, or are reversed in the UI. $legacy_options = array( 'bp-enable-private-network', 'bp-disable-account-deletion', 'bp-disable-avatar-uploads', 'bp-disable-cover-image-uploads', 'bp-disable-group-avatar-uploads', 'bp-disable-group-cover-image-uploads', 'bp_disable_blogforum_comments', 'bp-disable-profile-sync', 'bp_restrict_group_creation', 'hide-loggedout-adminbar', ); $legacy_options = array_intersect( $legacy_options, $legacy_names ); foreach( $legacy_options as $legacy_option ) { // Note: Each of these options is represented by its opposite in the UI // Ie, the Profile Syncing option reads "Enable Sync", so when it's checked, // the corresponding option should be unset. $value = isset( $_POST[$legacy_option] ) ? '' : 1; bp_update_option( $legacy_option, $value ); } } }

方法

问题吗?

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