Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
… into allow-for-og-image-w-h-type-to-be-null
  • Loading branch information
pls78 committed Nov 5, 2024
2 parents 8e81bf8 + 6bcc7cd commit 3cfa2d4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/presenters/open-graph/image-presenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ protected function filter( $image ) {
if ( ! empty( $image_type ) && \is_string( $image_type ) ) {
$image['type'] = \trim( $image_type );
}
else{
$image['type'] = "";
}

$image_width = ( $image['width'] ?? '' );
/**
Expand All @@ -127,6 +130,9 @@ protected function filter( $image ) {
if ( ! empty( $image_width ) && $image_width > 0 ) {
$image['width'] = $image_width;
}
else{
$image['width'] = "";
}

$image_height = ( $image['height'] ?? '' );
/**
Expand All @@ -139,6 +145,9 @@ protected function filter( $image ) {
if ( ! empty( $image_height ) && $image_height > 0 ) {
$image['height'] = $image_height;
}
else{
$image['height'] = "";
}

return $image;
}
Expand Down

0 comments on commit 3cfa2d4

Please sign in to comment.