Log1x / acf-editor-palette

A Gutenberg-like editor palette color picker field for Advanced Custom Fields.
https://github.com/Log1x/acf-editor-palette
MIT License
95 stars 15 forks source link

Allow field to work in options pages #28

Closed davidwebca closed 3 years ago

davidwebca commented 3 years ago

Hi!

The field doesn't work properly in options pages, mainly because the wp-component file doesn't get enqueued. I've narrowed it down to line 275 : https://github.com/Log1x/acf-editor-palette/blob/master/src/Field.php#L275

What is this supposed to do? From what I understand, it enqueues the styles only if the wp-component script is not enqueued? Why is that?

Should it not be the reverse and could it not be simply added as an array of dependencies to wp_enqueue_style / wp_enqueue_scripts a few lines under?

Log1x commented 3 years ago

don't 100% recall my reasoning behind that but feel free to do a PR if what you mentioned works as intended