devinsays / options-framework-theme

An Options Panel Framework to help speed theme development.
http://wptheming.com/options-framework
GNU General Public License v2.0
754 stars 229 forks source link

Issue with Option ID #204

Closed alanpilloud closed 7 years ago

alanpilloud commented 8 years ago

Hello,

There is something I don't understand.

In the file options.php we can define an option name with that function :

function optionsframework_option_name() {
    // Change this to use your theme slug
    return 'options-framework-theme';
}

However, returning a string seems to do nothing as in the method set_theme_option in class-option-framework.php, all that is done is calling the function without handling its return.

If I look in previous releases of the theme, options.php is different :

function optionsframework_option_name() {

    // This gets the theme name from the stylesheet
    $themename = wp_get_theme();
    $themename = preg_replace("/\W/", "_", strtolower($themename) );

    $optionsframework_settings = get_option( 'optionsframework' );
    $optionsframework_settings['id'] = $themename;
    update_option( 'optionsframework', $optionsframework_settings );
}

So, should we continue to update the option through optionsframework_option_name ?

Thanks a lot and have a nice day.