devinsays/options-framework-plugin — Issue #82: Feature request, not an issue
Author: anointed
Created: 2011-12-28 09:08:51+00:00
State: open

I've been thinking this through a lot and came up with an idea I wanted to bounce off you.

The options framework plugin looks in the current theme for an options.php file and if it finds one it does it's thing.

In my situation I am using options framework plugin to actually control bbPress templates that are inserted into a theme, so the options would be the same for every theme.

The only thing that changes is the values that the user inputs into the options panel.

Idea:
Instead of saving all the options in the database the way it is now, why not prefix the options in the database with the current theme name...

That way if a user activates a new theme, and then loads the options panel this would happen:

1. User activates 'twentyten' theme , options panel sees new theme, checks db for options, none exist for that theme because it looks for options-twentyten-option-x
2. options panel creates a new reset value into the db for the new theme options-twentyten-xxxxx
3. user fills in new options values

4. user activates twentyeleven theme
5. options panel looks in database, finds the options because twentyeleven was loaded prior and simply loads the values from the database, options-twentyeleven-option-xxxx

Reason:
I don't want to have a user have to add a file options.php file to their theme because if they update their theme, the way WordPress works, the theme is deleted and then replaced. The user looses the options.php file every time.

I tried this way, but everyone using themes from WordPress were complaining that everytime they updated WordPress themes that their options panel quit working. Reminding them to replace the options.php file became tedious.

By taking care of all of this within the options framework plugin then I don't ever have to worry about this again.

Downside:
means that you have to have the same options for every theme. The only thing that is changing is the value input by the user for each option on a per theme basis.

I can provide a plugin proof of concept as to why this would be a great option to have if it would help.