Updating themes for 1.4.5 version, and noticed that all of my OPTION_TYPE_TEXTAREA and OPTION_TYPE_TEXTBOX options were being returned as serialized arrays when using the getOption function in the theme. My plugins do not, just my themes. Hard to compare with included themes since none of them use these option types. I think this was an issue before 1.4.5, it was probably the cause of the issue in this thread:
http://www.zenphoto.org/support/topic.php?id=90536For example, when I have this entered in the backend OPTION_TYPE_TEXTAREA option:
`body{background:red;}`
I get this on the frontend when I echo the option:
`a:1:{s:5:"en_US";s:21:"body{background:red;}";}`
Any ideas?
Comments
Fields that are stored plain will be changed on re-saving like titles for example.
I had forgotten about that change myself actually and stumble upon it recently (https://github.com/zenphoto/zenphoto/issues/448).
There is a function to get the right one: http://www.zenphoto.org/documentation/core/_functions-i18n.php.html#functionget_language_string
`'multilingual' => false`
This is convenient when there is no reason for the option to be multilingual, like my example above (css), or number parameters for example.
https://github.com/zenphoto/DevTools/blob/master/demo_plugin-and-theme/demo_plugin/zenphoto_demoplugin.php
(which is linked from here http://www.zenphoto.org/news/zenphoto-plugin-architecture as well)
'multilingual' => false"
I'm having the same issue and tried to disable multilingual as above...after a couple hours, unfortunately not having much luck. Tried a few different setups but still getting arrays. Can someone please specify how/where to add this option to themeoptions.php?
It was that way before and changed for that exact reason. You can get the one of the current language using this function: http://www.zenphoto.org/documentation/core/_functions-i18n.php.html#functionget_language_string
Note that if you already have saved the option in multi-lingual mode you will need to clear it out before saving in single text mode.