Skip to content

Commit

Permalink
fetch image meta if not passed
Browse files Browse the repository at this point in the history
  • Loading branch information
tschortsch committed May 31, 2018
1 parent c042de0 commit c1b1ec0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/class-rokka-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down

0 comments on commit c1b1ec0

Please sign in to comment.