Theme options being returned as serialized array?

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:

For example, when I have this entered in the backend OPTION_TYPE_TEXTAREA option:

I get this on the frontend when I echo the option:

Any ideas?


  • acrylian Administrator, Developer
    That is correct now, all multilingual capable fields are now stored as serialized arrays always. Formerly they only were if you were in multilingual mode which caused some issues if you switched back. That's because it was changed.

    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 (

    There is a function to get the right one:
  • gjr Member
    Ah ok, I see that now, thanks. For the benefit of others, there is a way to turn off multilingual mode in an option array in your themeoptions.php file:

    `'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.
  • "For the benefit of others, there is a way to turn off multilingual mode in an option array in your themeoptions.php file:

    '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?
  • acrylian Administrator, Developer
    You always get arrays no matter if enabled or not. Multiple langauges ares stored in one database field as serialized arrays. If they wouldn't if you disable multilingual and re-save a multilingual page you would loose all the multilingual content.

    It was that way before and changed for that exact reason. You can get the one of the current language using this function:
  • That code belongs in the array that defines the particular option. For instance: `gettext('Theme logo') => array('key' => 'Theme_logo', 'type' => OPTION_TYPE_TEXTBOX, 'multilingual' => 0, 'order' => 8, 'desc' => gettext('The text for the theme logo'))`

    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.
Sign In or Register to comment.