Skip to content

Extensibility Serialization

Mark Vincent edited this page Jun 18, 2019 · 3 revisions

ASB Logo

This document is designed to explain the concepts of serializing the settings of an Advanced Sidebox addon module. For further details, view the entire list of extensibility documents: Extensibility Docs

Serialization

Multiple select elements used in MyBB settings (which ASB settings are based on) require serialization to be stored correctly.

In order to allow developers to validate settings before they are saved, the API has been extended with the settings_save function

function asb_serialization_example_settings_save($settings)
{
	$settings['multi_setting'] = serialize($settings['multi_setting']);
	return $settings;
}

As you can see, the settings are passed to the function and returned again after the module has had a chance to validate, serialize, and/or modify settings data.

For a working example, look here: Simple Setting Serialization Example

Clone this wiki locally