diff --git a/src/class-rokka-helper.php b/src/class-rokka-helper.php index 46d27ab..8052bc0 100644 --- a/src/class-rokka-helper.php +++ b/src/class-rokka-helper.php @@ -853,6 +853,10 @@ public function get_size_by_image_name( $image_id, $image_name, $image_meta = ar * @return string */ public function get_size_by_image_url( $image_id, $image_url, $image_meta = array() ) { + if ( empty( $image_meta ) ) { + $image_meta = wp_get_attachment_metadata( $image_id ); + } + $last_slash_pos = strrpos( $image_url, '/' ); if ( false === $last_slash_pos ) {