mujahidi / acf-typography

A Typography Add-on for the Advanced Custom Fields Plugin
https://wordpress.org/plugins/acf-typography-field/
GNU General Public License v2.0
18 stars 6 forks source link

Fonts defined in Gutenberg blocks not enqueued #18

Closed landinr closed 3 years ago

landinr commented 3 years ago

When we have a page with just gutenberg blocks, then the font(s) defined in the blocks are NOT enqueued. This is because the code looks just for fields in the post and global options. It does not look for fields in the blocks.

mujahidi commented 3 years ago

@landinr Can you please share a screenshot of the block or steps to reproduce this?

landinr commented 3 years ago

Should not be a problem, asking our development team to take a look and will get you a screenshot ASAP.

iajay commented 3 years ago

Consider a simple custom ACF block with a typography field Add this block to a page, set the font to a google font No other fields on this page Then the google font specified in the block wont enqueue The code in the functions.php is just looking for page fields and option fields https://www.evernote.com/l/AAhuqyzlgEZCOZ8tlLCFeVTtpax8q-kPYpsB/image.png But it does not look for fields in the blocks added to the page Let me know if this is not clear regards

mujahidi commented 3 years ago

Thanks @iajay . I will look into it.

mujahidi commented 3 years ago

@landinr @iajay Can you guys test https://github.com/mujahidi/acf-typography/commit/ed410919384b465fb3d44df744c4662d1920fe0a