• Hey all,

    I’m trying to add the WordPress color picker that was introduced in 3.5 to a widget I’m building. I’ve followed the steps as documented here – https://zourbuth.com/archives/877/how-to-use-wp-color-picker-in-widgets/#comment-43431

    The first time I add the widget to the sidebar, two instances of the color picker shows up in the settings. Only one of them works. Then, if I save the settings, suddenly only one is showing and all is well. I can’t figure out why this is happening or how to fix it.

    I’ve tried deactivating all other plugins and even installing some other third-party plugins that also use the color picker in a widget and they all do the same thing. Any thoughts on how to fix this?

    Thx.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator bcworkz

    (@bcworkz)

    Have you tried the author’s latest suggestion of using .ajaxComplete() instead of .ready()?

    Thread Starter Book Wookie

    (@bookwookie)

    Yes, I did. While it eliminated the problem of showing the color picker twice, the color picker didn’t work at all.

    I’d really love to solve this problem, but I’m starting to wonder if it might just be easier to see about using the old Farbtastic color picker instead.

    Thread Starter Book Wookie

    (@bookwookie)

    So, based on the lack of response here I guess the solution is that there is no solution? I’ve tried every method that I’ve come across in Internet searches and nothing works. I’ve even tried using the Farbtastic color picker, which comes with its own set of issues when the widget is first added to the sidebar.

    At this point I guess I have no choice but to release my plugin with a known bug. So sucks.

    Moderator bcworkz

    (@bcworkz)

    No idea on the proper fix, but I’m wondering if you “pre-saved” a default setting when the widget is constructed if it would prevent the extra picker box from displaying. Find the stored settings of a widget in use in the options table and insert that same thing during construction. Should be under the key widget_my_color_picker or similar.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WordPress Color Picker Duplication’ is closed to new replies.