<?php defined('ABSPATH') OR die('Direct Access Restricted!');
/**
 *
 * @param array $settings Key value pair of settings.
 * @return mixed True on successful save and false on failure. Actually it is the result of 'update_option'
 */
function o365_save_settings( $settings ){
    $updateable_settings = o365_get_settings();
    foreach( $settings as $name => $value ){
        $updateable_settings[$name] = $value;
    }

    $o365_settings = get_site_option('o365_settings'); // get setting option && isset($updateable_settings['shared_settings']) && $updateable_settings['shared_settings'] == "yes"
	
    if ( is_multisite() && strstr($_SERVER['HTTP_REFERER'], 'wp-admin/network')  ) {  
		return update_site_option( 'o365_settings', $updateable_settings );
	} else { 
		return update_option( 'o365_settings', $updateable_settings );
	}
}