Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm trying out the Options Framework, and I've started hacking options.php.

I have reduced the amount of options, and one of the options left is an image upload.

I have gone into Theme Options, and uploaded an image (for the logo), but I cannot find mention of this anywhere in the database. If I search phpmyadmin for the option id, I find a result in the wp_posts table. The option ID turns up as the post title. I thought it should be in the wp_options table.

Here is options.php

Here is inc/options-framework.php

UPDATE

The theme I have integrated the Options Framework into is contained in a folder call RWWA. options.php contains:

$optionsframework_settings['id'] = $themename;

so, I was assuming that each individual options would be called RWWA_optionname.

However, I have since found there is an entry in wp_options called RWWA, and its value is

a:3:{s:6:"colour";s:0:"";s:13:"logo_uploader";s:0:"";s:12:"banner_image";s:7:"forrest";}

where logo_uploader is the id of the image upload option, and banner_image is the id of an image select option.

So it looks like each option is not being saved in the format of $themename_$optionname.

You can look at the code of Options Framework here.

UPDATE

I've tested using the whole Options Framework Theme Master, from which I used some components, and the theme master saves options in the same way, under a generic entry in wp_options called "options_framework_theme_master"

How do I reference a specific option in this format?

share|improve this question
    
We need to see the markup for the settings form itself. If I had to guess, the problem is probably that the form enctype isn't multipart/form-data. –  Chip Bennett Dec 26 '12 at 12:45
    
@ChipBennett added a link above. –  Steve Dec 27 '12 at 5:52

2 Answers 2

The options are saved as an array under a single key, what you see in the db is serialized data. WordPress takes care of unserializing the data when the option is loaded, so you can reference each individual option the same way you'd reference an element in any php array:

$my_options = get_option('RWWA');
echo $my_options['colour'];
share|improve this answer
up vote 0 down vote accepted

Selecting the theme master as the current theme outputs instructions to the front page of the website. Amongst the instructions is the necessity to use the code:

of_get_option($id,$default)

So, I needed to use:

of_get_option('logo_uploader')
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.