BP_Admin_Tab::settings_save()

Method to save the fields

Description

By default it’ll loop throught the setting group’s fields, but allow extended classes to have their own logic if needed

Source

File: bp-core/classes/class-bp-admin-tab.php

	public function settings_save() {
		global $wp_settings_fields;

		$fields = isset( $wp_settings_fields[ $this->tab_name ] )? (array) $wp_settings_fields[ $this->tab_name ] : [];

		foreach( $fields as $section => $settings ) {
			foreach( $settings as $setting_name => $setting ) {
				$value = isset( $_POST[$setting_name] ) ? $_POST[$setting_name] : '';
				bp_update_option( $setting_name, $value );
			}
		}
	}

Changelog

Changelog
Version Description
BuddyBoss 1.0.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.