Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Ben

    (@runpixelrun)

    I’m using ACF Pro.

    Hi Ben,

    I believe this is a known issue with this plugin as well as it’s use within a repeater. I’d love to see this implemented into the ACF core someday. ??

    Thread Starter Ben

    (@runpixelrun)

    So no fix or workaround?

    Plugin Author danielpataki

    (@danielpataki)

    Hi all,

    I’m pushing out a new version and I am hopeful it will work. If you are still running into this issue please let me know, I’ll try and be faster this time ??

    Daniel

    Nicscott01

    (@nicscott01)

    Doesn’t look like this has been resolved. I looked at the code, and in the functions.php file, the function acfgfs_get_fonts_to_enqueue() needs to traverse deeper than the first level to look into repeaters.

    For now, I’ll use the filter acfgfs/enqueued_fonts as a workaround, and add my own fields to the array.

    Please let me know if you would like help with this fix.

    Nicscott01

    (@nicscott01)

    If anybody is interested in how to easily add your repeater/flexible fonts to the enqueued list handled by the acfgfs plugin:

    add_filter('acfgfs/enqueued_fonts', 'cc_additional_fonts');
    function cc_additional_fonts( $font_list ) {
    	$additional_fonts = get_field('additional_fonts', 'options'); //this is where you get your field(s) of font(s) in the repeater/flexible content field.
    	$add_fonts = array(); //initialize the new array
    	foreach ( $additional_fonts as $font ) { //go through the array and pull out the sub field that has your font (here it's named "font");
    		$add_fonts[] = $font['font']; //add each one to the new list
           }
    		$font_list = array_merge( $font_list, $add_fonts);
    return  $font_list;
    }
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Fonts added as ACF flexible field don't get loaded’ is closed to new replies.