Skip to content

Commit

Permalink
lodestar: Sync D134558: Handle the case where there is no featured im…
Browse files Browse the repository at this point in the history
…age (PHP 8.1 Warning) (#7609)
  • Loading branch information
mreishus authored Jan 12, 2024
1 parent e341696 commit 658e37f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lodestar/components/header/header-image.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
elseif (
( is_post_type_archive( 'jetpack-portfolio' ) || is_tax( 'jetpack-portfolio-type' ) || is_tax( 'jetpack-portfolio-tag') || 'jetpack-portfolio' === get_post_type() ) && isset( $jetpack_portfolio_featured_image ) && '' != $jetpack_portfolio_featured_image ) :

$featured_image_attributes = wp_get_attachment_image_src( $jetpack_portfolio_featured_image, 'lodestar-featured-image' ); ?>
$featured_image_attributes = wp_get_attachment_image_src( $jetpack_portfolio_featured_image, 'lodestar-featured-image' );
$ft_image_url = is_array( $featured_image_attributes ) ? $featured_image_attributes[0] : false;
?>

<div class="custom-header-image" style="background-image: url(<?php echo esc_url( $featured_image_attributes[0] ); ?>)">
<div class="custom-header-image" <?php if ( $ft_image_url ) echo 'style="background-image: url(' . esc_url( $ft_image_url ) . ')"'; ?>>
<?php get_template_part( 'components/header/site', 'branding' ); ?>
</div>

Expand Down

0 comments on commit 658e37f

Please sign in to comment.