That seems unlikely, as OT doesn’t modify the CSS of Thickbox nor does it execute any JS until the .ot_upload_media
button is clicked. What version of OT are you using?
Thread Starter
Mal
(@looimaster)
Thread Starter
Mal
(@looimaster)
That’s not the only thing – it also changes style of colorpicker that the theme I use uses. It’s perhaps because it’s very common colorpicker. Unfortunately, it becomes partially broken after activating OT. It works but its style is wrong and I can’t type in color code manually.
Can you perhaps make plugin files load only on its sub-page? I’ve seen that WordPress suggests that in Codex just a few days ago and there was an example on how to make that happen.
It makes a lot of sense to use NAMESPACE for themes and plugins but sooo many people don’t do this (in this case both theme author and plugin author) and therefore CSS or JS is in conflict.
OptionTree doesn’t load on every page! You need to look at the code before you start making assumptions. The CSS & JS are loaded for admin pages using the code below, which means it loads only for pages that match the hook set in the array passed to ot_register_settings
that builds the UI and no other pages.
/* add scripts */
add_action( 'admin_print_scripts-' . $page_hook, array( &$this, 'scripts' ) );
/* add styles */
add_action( 'admin_print_styles-' . $page_hook, array( &$this, 'styles' ) );
The only exception to that rule is if OT_META_BOXES
is set to true, then it will load on post.php
& post-new.php
like so:
/* add scripts for metaboxes to post-new.php & post.php */
add_action( 'admin_print_scripts-post-new.php', 'ot_admin_scripts', 11 );
add_action( 'admin_print_scripts-post.php', 'ot_admin_scripts', 11 );
/* add styles for metaboxes to post-new.php & post.php */
add_action( 'admin_print_styles-post-new.php', 'ot_admin_styles', 11 );
add_action( 'admin_print_styles-post.php', 'ot_admin_styles', 11 );
Thread Starter
Mal
(@looimaster)
Relax 🙂 Since I’m not a good coder I just show you what I see and it’s up to you to take a look at that or not. I really appreciate the plugin and the fact that it’s free LGPL work. Those issues are minor and easy to live with.
Two facts:
1) On “Add New Post” (custom post type) page #TB_window gets top
which is in conflict with other plugins/themes that use Thick Box with default ID.
2) Colorpicker on the same page changes from dark skin to light.
Before: http://gyazo.com/73e0f34987d297c3faebb4c3c100672b
After: http://gyazo.com/54d24803a5a772d48ccee87e62f80629 (and color code field stops working).
There are clearly at least two conflicts. As a side note none of the plugins (or theme) modifies anything on OT page. It’s just OT modifying something on other plugins’/themes’ pages.
I’m unfortunately not sure what exactly the code you mentioned above does but again – it’s just my kind and friendly remark. I’m not expecting you to do anything about it 🙂 I just noticed two issues and I report them – that’s all! Thanks for replies 🙂
What plugin specifically does it conflict with and what page is it changing the colorpicker on?
Try version 2.0.11 and see if the issue still persists.
Thread Starter
Mal
(@looimaster)
It’s custom post type called “Portfolio” and it’s its [Portfolio > Add New] but not only there. Well, some of my clients reported this and I can confirm that indeed it does happen, so I’m reporting it to you 🙂
Like I said – it’s nothing crucial and we can live with that but if you have some spare time and you’d like to improve your nice plugin then it’s just another feedback from user.
Yes, I’m using 2.0.11.
I’m all about making it better, but without more information I can’t do a whole lot.