acf-icon-picker
acf-icon-picker copied to clipboard
feat: Fix compat with ACF 6.3
Hi @houke ,
Thanks for your work on this plugin! This PR creates the properties in advance to prevent dynamic creation of properties warnings in PHP 8.2 and above. I do have some other ideas as well for this plugin to further modernize the codebase if you're open to that.
Looking forward to your reply!
Update 31-05
Advanced custom fields 6.3 is now available and introduces it's own icon picker.
The class acf_field_icon_picker used in the plugin interfered with the new ACF field that has exactly the same classname.
My new set of changes do the following:
- Rename the field label to Icon field (custom) to differentiate between the two fields.
- move the field to the new category
advancedsincejqueryis no longer an existing category - Renamed the class from
acf_field_icon_pickertoacf_field_custom_icon_pickerso it does not longer interfere
After this the plugin loads again as needed. I would really like to have an update for this since this breaks quite a lot of websites I run. I am open for any suggestions you have!
Hi @houke ,
Sorry for being annoying with the mentions, but I would really like to have this fix out as soon as possible. Let me know if I can help in any way to speed this up.
Hi @houke ,
Thanks for your work on this plugin! This PR creates the properties in advance to prevent dynamic creation of properties warnings in PHP 8.2 and above. I do have some other ideas as well for this plugin to further modernize the codebase if you're open to that.
Looking forward to your reply!
Update 31-05
Advanced custom fields 6.3 is now available and introduces it's own icon picker.
The class
acf_field_icon_pickerused in the plugin interfered with the new ACF field that has exactly the same classname. My new set of changes do the following:* Rename the field label to **Icon field (custom)** to differentiate between the two fields. * move the field to the new category `advanced` since `jquery` is no longer an existing category * Renamed the class from `acf_field_icon_picker` to `acf_field_custom_icon_picker` so it does not longer interfereAfter this the plugin loads again as needed. I would really like to have an update for this since this breaks quite a lot of websites I run. I am open for any suggestions you have!
Thank you for the solution provided!
@Levdbas Thanks for this solution! I wondered, why it's not working anymore. 😉
On line 7 of the file fields/acf-icon-picker-v5.php I also had to change if (!class_exists('acf_field_icon_picker')) : to if (!class_exists('acf_field_custom_icon_picker')) : so that the plugin works again.
Hi @blakerr , @phschmanau: There is now a fork available that fixes this issue and more: https://github.com/smithfield-studio/acf-svg-icon-picker
We plan on actively developing this in the future