Upgrading to Newest Build
I am upgrading to the latest version, I am currently using v.3.3.6, and looking at the new build I noticed a few changes. I tried looking at the Changelog page but looks like its empty.
I am wondering if you can give me some tips on the correct way to install v.3.5.6.5, any gotchas that I may run into from v.3.3.6.
The Redux framework is currently built into my theme, I am not using the plugin:
- Do I need to download a different version if not using the plugin then the Git download on this page https://github.com/reduxframework/redux-framework
- In the older version I placed all my options in this file and location: admin/option-init.php, which is located in the root directory of the framework. But seems this has changed. Which file needs to be updated with my unique theme options.
- In sample-config.php file in the new build I see that you are using 'Redux::setSection' where in the older version I was using '$this->sections[]'
- What are some of the new features that you have added since v.3.3.6
- Anything else you can recommend that will make the upgrade process easier.
thanks for you time.
Not empty: https://github.com/reduxframework/redux-framework/blob/master/CHANGELOG.md
Most of your questions can be answered via the changelog. The new sample config uses the Redux API, which you can read about on the docs site: https://docs.reduxframework.com/core/redux-api/
As to where to put your options-config? Anywhere but the redux-framework folder, especially if you use the plugin. I keep mine in root/admin (and then all my sections in separate PHP files in a section directory, but that's simply my personal preference. Makes it easier to find options.
I can't think of any 'gotchas', although since you asked for a tip, use the builder. it outputs the API config now: https://build.reduxframework.com
I am running into some issues, hopefully you can help. After the steps listed below my global variable $theme_options is returning 'null' instead of all the theme options, not sure what I did wrong.
Wordpress version: 4.2.2 PHP version: 5.3.10 Redux Version: 3.5.5 Using Localhost
- I took your advice and used the builder to download the newest version, the embed version, not the plugin.
- Replaced these files and folders with the new build files and folders 'admin-init.php' folder: redux-framework folder: redux-extensions
- Took the new 'options-init.php' file and added an include for a file containing all my theme options require_once dirname(FILE).'/theme_options.php'; which is in the same directory as 'options-init.php', the root.
- Changed all my old sections from this format '$this->sections[] = array(...; to the new format 'Redux::setSection( $opt_name, array(...
- In the backend hit refresh and saw an error on the Tools->Redux Framework page. Seems there is a typo in this file 'redux-framework\inc\welcome\views\status_report.php' line #358 ''rexux_clean" changed to 'redux_clean'. This fixed the error and the page loads correctly.
- I reviewed the 'Redux Instance' table, under the Status Tab, here is what I have opt_name: theme_options global_variable: theme_options
- Under the 'Sample Options' tab/section under the Wordpress main menu sidebar 'Reset All' and 'Saved Changes'. All my options are showing up correctly.
- In my theme function.php file I tried to var_dump to see all the options but its now returning 'null' global $theme_options; var_dump($theme_options); // returns NULL
Did I miss a step?
The first being you are using an old version. Please upgrade first. We're up to 3.5.6.6 now. Old versions are unsupported. If after upgrading issues persists, post back with a support URL https://docs.reduxframework.com/core/generating-a-support-hash/
Maybe I misunderstood, are you saying the online building doesn't export the newest version when you export it?
Seems what I was missing was how the new API initialized the framework, by using: 'Redux::init('theme_options');
So now I am able to var_dump my options, $option = Redux::getField('theme_options', 'primary_color'); var_dump($option);
But this returns the entire contents of the section not what the option is currently set to. I looked in the Redux API page but couldn't find how to get the value of the option I want. Think if you can just show me a code example to get the value of an option I should be good to go.
thanks
But this returns the entire contents of the section not what the option is currently set to. I looked in the Redux API page but couldn't find how to get the value of the option I want. Think if you can just show me a code example to get the value of an option I should be good to go.
The API currently has no getOption/setOption. Soon, hopefully. In the meantime, you'll have to use get_option.
$options = get_option($opt_name);
$option = $options['option_id'];
Thank so much for your help got it working now