Home › Forums › Feature Requests › Combine color picker swatches with theme.json › Reply To: Combine color picker swatches with theme.json
Hey @proxxim, thanks for the suggestion.
You could do this now using getEditorSettings which includes the color palette, so something like the following js filter:
acf.addFilter('color_picker_args', function (args) { const settings = wp.data.select( "core/editor" ).getEditorSettings(); let colors = settings.colors.map(x => x.color); args.palettes = colors; return args; });
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.