diff --git a/includes/class-featured-image-by-url-common.php b/includes/class-featured-image-by-url-common.php index 49d14bd..713bf80 100644 --- a/includes/class-featured-image-by-url-common.php +++ b/includes/class-featured-image-by-url-common.php @@ -138,6 +138,14 @@ public function knawatfibu_resize_image_on_the_fly( $image_url, $size = 'full' ) return $image_url; } + /** + * Photon doesn't support query strings so we ignore image url with query string. + */ + $parsed = parse_url( $image_url ); + if( isset( $parsed['query'] ) && $parsed['query'] != '' ){ + return $image_url; + } + $image_size = $this->knawatfibu_get_image_size( $size ); if( !empty( $image_size ) && !empty( $image_size['width'] ) ){ diff --git a/templates/knawatfibu-metabox.php b/templates/knawatfibu-metabox.php index 37a9390..794aaa8 100644 --- a/templates/knawatfibu-metabox.php +++ b/templates/knawatfibu-metabox.php @@ -3,20 +3,28 @@ // Exit if accessed directly if ( ! defined( 'ABSPATH' ) ) exit; +$image_url = ''; +$image_alt = ''; +if( isset( $image_meta['img_url'] ) && $image_meta['img_url'] != '' ){ + $image_url = esc_url( $image_meta['img_url'] ); +} +if( isset( $image_meta['img_alt'] ) && $image_meta['img_alt'] != '' ){ + $image_alt = esc_attr( $image_meta['img_alt'] ); +} ?>