Proposed v3.2.4
@mujahidi - Tested and ready for final review.
It may seem like a lot, but the bulk majority of it is just code cleanup with tabs/spaces for easier readability.
I've tested against ACF v5 & v6. Both are functioning properly, but I found 2 UI visual bugs with v6:
- number field append "px" has really huge gap. It is a core ACF issue and I have notified them.
- color_picker field has a wrong sized button. Also a core ACF issue and I have notified them.
I figured you may want to change some of the wording for things. That's why it will be the NEXT release that officially supports translations ( #24 ) after you re-word anything to your liking. This release was just getting it prepared for it.
Highlights for actual code changes:
functions.php:
- Your enqueue function has been split into 4 functions: -- one handles post_id stuff and fixes the issue with trying to get an id of a non-object (WP Support topic) -- one handles getting the values for fields (based on valid post_id) -- one handles merging the values for fields (based on supplied values) -- one handles enqueueing the stylesheet (based on merged values)
- Checks for getting good results back for google_fonts.json file ( #27 )
- All new functions are setup and ready for integration with future enhancements (like saving stylesheets/font files locally)
- The rest is minor code cleanup
admin_settings.php
- Admin error messages if bad API Key or network issues ( #27 )
- Admin error messages if ACF not installed/activated
- Translation / Text Domain changes to get plugin ready for translations (next release)
acf-typography.php
- Translation / Text Domain changes to get plugin ready for translations (next release)
- Handle ACF versions proactively until ACF implements it in ACF core. Now supports ACF v6.
acf-Typography-v5.php
- changed field type from "text" to "color_picker" for text_color field which ACF v5 & v6 support.
acf-Typography-v6.php
- placeholder file that points to acf-Typography-v5.php for now, but is the future home for any v6-specific field changes
That's really about it. Everything else is superficial, minor code cleanup, and has zero impact on functionality.
@mujahidi
Update on ACF v6 UI issues for the number field with append gap issue, and color_picker button size issue: ACF acknowledged the issue and has forwarded support to the dev team & product team for both issues.
@mujahidi
- Misaligned tabs / spaces corrected using VSCode. Corrected in every file I altered. DONE
- Unnecessary line breaks removed. It's a personal code readability preference of mine that I think helps with code readability. Note taken and I will not add those line breaks to anything else I push to you in the future. DONE
Let me know if anything else needs changing.