I made a plugin for some calculation.
Class Math {
var $id; // I want to map this id to post_id
var $a;
var $b;
var $c;
function calculate{
$this->a = $value_from_post_meta_input_box;
$this->b = $data_generated_in_calculating_process;
$this->c = $result_of_some_function;
}
}
After activating the plugin, and setting up the post meta input box for $a, I am able to get $a saved in post meta.
Now, how can I save $b and $c to post meta? How to say the current calculation is an instance of Math with current post_ID ?
You can use
update_post_meta()
to save an array of values. It will be automatically serialized and unserialized.