From bfaa63f75c98953bae286dfeda9fee795b07d9e4 Mon Sep 17 00:00:00 2001 From: Marco Pereirinha Date: Mon, 8 Mar 2021 10:28:54 +0000 Subject: [PATCH] Add PGW support for CNAME --- php/media/class-gallery.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/php/media/class-gallery.php b/php/media/class-gallery.php index 8a3ee3b92..095f2a132 100644 --- a/php/media/class-gallery.php +++ b/php/media/class-gallery.php @@ -417,6 +417,13 @@ public function prepare_block_render( $content, $block ) { $attributes['mediaAssets'] = $attributes['selectedImages']; $attributes['cloudName'] = $this->media->plugin->components['connect']->get_cloud_name(); + + $credentials = $this->media->plugin->components['connect']->get_credentials(); + + if ( ! empty( $credentials['cname'] ) ) { + $attributes['secureDistribution'] = $credentials['cname']; + $attributes['privateCdn'] = true; + } unset( $attributes['selectedImages'], $attributes['customSettings'] ); ob_start();