Hi
I need to set custom color into Iris Palette, Color Picker.
I tried some code edits but didn’t work.
Could you help me?
https://wordpress.org/support/topic/universally-change-iris-palette
http://automattic.github.io/Iris/
I also tried this code
// customise palette colours function firefly_customize_controls_print_footer_scripts() { ?> <script> jQuery(document).ready(function($){ $.wp.wpColorPicker.prototype.options = { palettes: ['#ffffff', '#000000','#dd3333', '#dd9933','#eeee22', '#81d742', '#ff0000'] }; }); </script> <?php } add_action('customize_controls_print_footer_scripts', 'firefly_customize_controls_print_footer_scripts');
that works with the theme, but doesn’t work with your shortcodes.
Hi FuoriLuogo,
That will only change the color pallets in the customizer – nowhere else. If you really want to to be universal you should instead use:
So I just need to replace this code in the same file of the previous code, deleting the old one.
Right?
Hi FuoriLuogo,
Yes. Is there anything else I can help you with today?
It seems to work with SiteOrigin widgets and shortcodes, great!!
Is there a way to make it default in every color picker of my website?
Hi FuoriLuogo,
It should already be the default. Is it not?
I’m sorry, I mean,
how to set customized iris color picker default everywhere in my website?
I mean, replacing your code, now the customizer has wordpress colors and not mine.
Another plugin, has wordpress colors and not these ones I set as customized.
Is there a way to make this code (with customized colors), be shown in every color picker and not just in one plugin etc?
;)
Hi FuoriLuogo,
I guess the customizer acts off of the frontend code rather than the admin code. I’ve got no idea why the other plugin isn’t affected by the other change though seeing as the hook I used is the proper method for doing this sort of stuff. I’ve updated the code above so that it works with the customizer, and likely the other plugin.
I really don’t know.
thanks anyway
Hi FuoriLuogo,
So the above code change didn’t fix the issue?
It works now both with wordpress customizer and siteorigin’s plugins, not in other plugins :(
Hi FuoriLuogo,
Just to confirm; did it previously work with the other plugin?
The code I found on my own (on some forums) didn’t work at all even if it worked for other people.
The code in the first post, provided to me by theme’s author, worked only for the theme, not for plugins (even yours).
The last code you provided, it works both with theme (and wordpress customizer) and siteorigin’s plugins, not with others.
Hi FuoriLuogo,
I’m not too sure what to tell you. The change I made should work in theory for everything (minus the customizer but that was due to an assumption). :S Is there anything else I can help you with?
If you want to see the links in the first post, there is the source I find.