Title: [Plugin: OptionTree] Array issues
Last modified: August 20, 2016

---

# [Plugin: OptionTree] Array issues

 *  Resolved [THRIVE – Web Design Gold Coast](https://wordpress.org/support/users/deanoakley/)
 * (@deanoakley)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-optiontree-array-issues/)
 * This plugin seems to work great. First time I’ve used it so not 100% sure this
   is a bug but…
 * I couldn’t get the Array output to work at all. A little digging and I discovered
   that the Array keys are strings.
 *     ```
       [background] => Array
               (
                   [background-color] => #ffffff
                   [background-repeat] => repeat
                   [background-attachment] => scroll
                   [background-position] => left top...
       ```
   
 * So I don’t think `get_option_tree( 'background', $theme_options , true , true,
   0);` can work.
 * I updated get-option-tree.php to except strings as the offset so now I have
 * `get_option_tree( 'background', $theme_options , true , true, 'background-color');`
 * Which seems more readable also. Am I doing this wrong?
 * [http://wordpress.org/extend/plugins/option-tree/](http://wordpress.org/extend/plugins/option-tree/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [THRIVE – Web Design Gold Coast](https://wordpress.org/support/users/deanoakley/)
 * (@deanoakley)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-optiontree-array-issues/#post-2521279)
 * Is this plugin still in development?
 *  Plugin Author [Derek Herman](https://wordpress.org/support/users/valendesigns/)
 * (@valendesigns)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-optiontree-array-issues/#post-2521280)
 * Yes the plugin is in development. The issue you’re having is that the get_option_tree()
   function which is deprecated in 2.0 (coming this week) doesn’t take into account
   a couple of edge use cases. However, you can just do the following to get around
   the numeric key issue and trick OT into giving your a csv version of your array:
 * `$background = explode( ',', get_option_tree( 'background' ) );`
 * Now you should be able to echo your array values by the proper key like so:
 * `echo $background['background-color'];`
 * In the new version the ot_get_option() function just grabs the value you ask 
   for an returns it to you as is so you can perform operations on it yourself. 
   Also, I’ve made an adjustment in the old get_option_tree() function to allow 
   non numeric keys.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: OptionTree] Array issues’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/option-tree_363534.svg)
 * [OptionTree](https://wordpress.org/plugins/option-tree/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/option-tree/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/option-tree/)
 * [Active Topics](https://wordpress.org/support/plugin/option-tree/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/option-tree/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/option-tree/reviews/)

## Tags

 * [OptionTree](https://wordpress.org/support/topic-tag/optiontree/)

 * 2 replies
 * 2 participants
 * Last reply from: [Derek Herman](https://wordpress.org/support/users/valendesigns/)
 * Last activity: [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-optiontree-array-issues/#post-2521280)
 * Status: resolved