Most of wordpress plugin writer choose the new table for saving data for plugin setting and any setting in wordpress plugin. In this article we will show, how to use update option in wordpress plugin. I recommend to use the update option for saving data in wordpress database.
how to use update option in wordpress plugin
There is ready made option is provided by wordpress to save custom data in there table.
Here with very simple code I will show how use save the data in wordpress database.
< ?php $variable = array(‘var1′ => $_POST['var1'], ‘var2′ => $_POST['var2']); update_option(‘myPlugin_var1′, serialize($variable)); get_option(‘myPlugin_var1′) == “” ? “” : $new = unserialize(get_option(‘myPlugin_var1′)); ?> You should save data in simple variable format or I suggest always save data in array format.
For more reference you can check the following URL
http://phpxref.com/xref/wordpress/wp-admin/options.php.source.html
Hi, I’m very interested in Linux but Im a Super Newbie and I’m having trouble deciding on the right distribution for me (Havent you heard this a million times?) anyway here is my problem, I need a distribution that can switch between reading and writing in English and Japanese (Japanese Language Support) with out restarting the operating system.
Hey, why in this case you use the serialize PHP function instead of saving the array as it???