WordPress.org

Forums

OptionTree
OptionTree causes conflicts with other plugins and themes (10 posts)

  1. Marco
    Member
    Posted 2 years ago #

    Basically, OptionTree modifies style of #TB_window used by other plugins and themes. A theme that I use uses #TB_window (WordPress built-in Thickbox component - its it's standard ID) and OptionTree makes its position wrong... (on load it gives it inline style: -431px on 1920x1080px monitor for unknown reason) and it originally is 0px.

    http://wordpress.org/extend/plugins/option-tree/

  2. Derek Herman
    Member
    Plugin Author

    Posted 2 years ago #

    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?

  3. Marco
    Member
    Posted 2 years ago #

    The newest version of OT. When I deactivate it - everything returns back to normal.

    JSFiddle: http://jsfiddle.net/metwG/

    Before: http://img51.imageshack.us/img51/3241/normalcf.jpg
    After: http://img15.imageshack.us/img15/781/aftervu.jpg

  4. Marco
    Member
    Posted 2 years ago #

    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.

  5. Derek Herman
    Member
    Plugin Author

    Posted 2 years ago #

    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 );
  6. Marco
    Member
    Posted 2 years ago #

    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 :)

  7. Derek Herman
    Member
    Plugin Author

    Posted 2 years ago #

    What plugin specifically does it conflict with and what page is it changing the colorpicker on?

  8. Derek Herman
    Member
    Plugin Author

    Posted 2 years ago #

    Try version 2.0.11 and see if the issue still persists.

  9. Marco
    Member
    Posted 2 years ago #

    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.

  10. Derek Herman
    Member
    Plugin Author

    Posted 2 years ago #

    I'm all about making it better, but without more information I can't do a whole lot.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • OptionTree
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.