New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto Import Theme Options #122
Comments
Some Updates: I think there are some problems with "compat_ot_import_from_files" function. The function at first loads the options and layouts files with get_stylesheet_directory() and get_template_directory() functions but finally it uses wp_remote_get() to read the file content which returns error as the files are addressed locally and this function is using http to access the files. I've change this code: $get_data = wp_remote_get( $data_file );
if ( is_wp_error( $get_data ) )
return false;
$rawdata = isset( $get_data['body'] ) ? $get_data['body'] : ''; with this one: $fh = fopen($data_file, 'r');
$rawdata = fread($fh, filesize($data_file)); And it works perfectly. Of course we should do this for layouts auto import too. Is there anyway to fix this issue without modifying plugin files directly? Thanks |
Wouldn't using |
Once it's sorted you probably shouldn't rely on the deprecated 1.x branch However, I still want to solve the issue at hand, so definitely check the alternative functions to see if they work. Cheers! |
@imangm could you do me a favor and please verify that using |
@imangm I chose to bump this up to 2.1 and I've gone ahead and changed the paths to be Anyhow, version 2.1 is going live either later tonight or more likely tomorrow, because there is one more feature that needs testing; WPML. Anyhow, if you could please confirm that it's working correctly I would really greatly appreciate it. Cheers! |
Hi Derek, I'm really sorry as I didn't answer you on time. I was on a vacation. If you still have time, I would answer it in a few hours. |
No worries, looking forward to your reply. |
Hi Derek. I'm so sad as I disappointed you. I'm using your great plugin but I didn't help when I could... I've upgraded OT to the latest version (2.1.2) putting theme-options.txt and layouts.txt on OT root directory and then installed the theme and after installing, I'm getting several errors on Theme Options page which I think are related to this new importer: Notice: Undefined index: active_layout in D:\xampp\htdocs\wp2\wp-content\themes\ot_ultraflex\option-tree\includes\ot-functions-admin.php on line 3683 Notice: Array to string conversion in D:\xampp\htdocs\wp2\wp-content\themes\ot_ultraflex\option-tree\includes\ot-functions-admin.php on line 3708 Notice: Array to string conversion in D:\xampp\htdocs\wp2\wp-content\themes\ot_ultraflex\option-tree\includes\ot-functions-admin.php on line 3708 Notice: Array to string conversion in D:\xampp\htdocs\wp2\wp-content\themes\ot_ultraflex\option-tree\includes\ot-functions-admin.php on line 3708 It seems that most of the theme options are load currently but the page is full of these errors. I will work on it. Maybe it's because that I've exported theme-options in the old version. Here is the screenshot: http://cdn.themique.com/tf/screenshot.png |
Shit! Okay that sucks, could you please send me your files so I can test it exactly the way you have it running? derek[at]valendesigns.com |
Hi, I think I've found the problem. When I go to OptionTree -> Settings -> Layouts, It lists all of my theme options as layouts. For example, I have blue, dark, light layouts, but now there are more than 200 layouts which names are similar to my theme options: tmq_layoutmode, tmq_favicon and ... |
You mean the theme or just my OT folder? |
The theme please. If you can. |
Sent. Please let me know if I can help too |
I figured it out!!!! Try the the |
I tested the hotfix on the theme you sent and everything seems to be working on my end, other than your radio images not displaying correctly. Edit: you can use PHP in your path for the radio images since you're setting it up via an array and not the UI builder. |
Could you please confirm. I want to roll out the hotfix before I go to sleep. |
in 5 minutes |
Hi Derek. Yes it works fine this time except radio images that I should fix them as you said on the previous comment. Thank you very much :) |
Hi,
First thanks for your great plugin (again).
I have a question. Is it possible to automatically import theme options and layouts after theme installation in theme mode?
There is a function named "compat_ot_import_from_files" in ot-functions.compact.php which I think will do what I want to do but I don't know how to use it. I have put theme-options.txt and layouts.txt files into option-tree folder but nothing happened and my theme is loaded without any saved options...
Any suggestions please?
Thanks
The text was updated successfully, but these errors were encountered: