diff --git a/includes/blocks/class-kadence-blocks-image-block.php b/includes/blocks/class-kadence-blocks-image-block.php index 9c26c1804..69da0b12b 100644 --- a/includes/blocks/class-kadence-blocks-image-block.php +++ b/includes/blocks/class-kadence-blocks-image-block.php @@ -291,7 +291,12 @@ public function build_css( $attributes, $css, $unique_id, $unique_style_id ) { if ( isset( $caption_font['textTransform'] ) && ! empty( $caption_font['textTransform'] ) ) { $css->add_property( 'text-transform', $caption_font['textTransform'] ); } - if ( isset( $caption_font['family'] ) && ! empty( $caption_font['family'] ) ) { + if ( isset( $caption_font['google']) && ! empty($caption_font['google'] ) ) { + $google = $caption_font['google'] ? true : false; + $google = $google && ( isset( $caption_font['loadGoogle'] ) && $caption_font['loadGoogle'] || ! isset( $caption_font['loadGoogle'] ) ) ? true : false; + $variant = ! empty( $caption_font['variant'] ) ? $caption_font['variant'] : null; + $css->add_property( 'font-family', $css->render_font_family( $caption_font['family'], $google, $variant ) ); + } elseif ( isset( $caption_font['family'] ) && ! empty( $caption_font['family'] ) ) { $css->add_property( 'font-family', $caption_font['family'] ); } if ( isset( $caption_font['style'] ) && ! empty( $caption_font['style'] ) ) { diff --git a/src/blocks/image/image.js b/src/blocks/image/image.js index 8b3b93a10..bac8e4557 100644 --- a/src/blocks/image/image.js +++ b/src/blocks/image/image.js @@ -96,6 +96,7 @@ import { GradientControl, BackgroundTypeControl, KadenceFocalPicker, + KadenceWebfontLoader, } from '@kadence/components'; export default function Image({ @@ -1845,6 +1846,18 @@ export default function Image({ __unstableOnSplitAtEnd={() => insertBlocksAfter(createBlock('core/paragraph'))} /> )} + {captionStyles[0].google && captionStyles[0].family && ( + + )} ); }