Customizing WooThemes Options Panel

I’ve decided to share higher-level stuff on my blog. I’ve been studying the WooFramework and decided I wanted to insert my own custom options into the WooFramework Options Panel. The woo_options_add function allows you to easily drop in your own options in the $options array by adding new values to the end of the array. I didn’t want to do that because I want these options in the Header options panel and not at the bottom or in its own panel. I found this article by WooThemes that tells me to edit the theme-options.php file but I didn’t want to do that either. So, I wrote my own function and placed it inside of the woo_options_add function in the parent functions.php file. It may not be perfect but it’s working for me.

The function below loops through the multidimsensional $options array trying to match $value['name']. If match is TRUE, insert the new field into the $options array. As you can see, I’m generating new keys too. If you know a better way to do this, please share. Also, check out my support group at http://fb.com/groups/internet.questions/

You can see in the image below that this function inserts a couple checkbox fields into the Options Panel.

Wooframework Customize Options Panel

About Clifton Hatfield

He fell in love with the WordPress Publishing Platform and has been creating themes and plugins for it ever since. He is the kind of guy that can read code better than he can read a book. Often, you can find him hunched over a keyboard delivering his magic. He likes cold pizza, walking on moving sidewalks, and Indiana Jones.
0 comments