From 836413ef047844c897c275d9ce0053f6f9c5106f Mon Sep 17 00:00:00 2001 From: Matthew Reishus Date: Wed, 3 Apr 2024 15:21:45 -0500 Subject: [PATCH] pub themes: Restore changes overwritten from latest themes deploy (D144213 D144218 D144223 D144228 D144234 D144240 D144244) (#7708) --- altofocus/inc/jetpack.php | 2 +- dyad-2/inc/extras.php | 6 +++++- lodestar/components/page/content-front-page-panels.php | 3 +++ radcliffe-2/inc/logo-resizer.php | 3 +++ seedlet/inc/wpcom.php | 10 +++++----- shoreditch/inc/extras.php | 2 +- 6 files changed, 18 insertions(+), 8 deletions(-) diff --git a/altofocus/inc/jetpack.php b/altofocus/inc/jetpack.php index 50d928da19..97e485def8 100644 --- a/altofocus/inc/jetpack.php +++ b/altofocus/inc/jetpack.php @@ -116,7 +116,7 @@ function altofocus_get_featured_post_ids() { if ( false === $featured_ids ) { $featured_options = get_option( 'featured-content', FALSE ); - $featured_tag_name = $featured_options[ 'tag-name' ]; + $featured_tag_name = $featured_options[ 'tag-name' ] ?? null; $term = get_term_by( 'name', $featured_tag_name, 'post_tag' ); if ( $term ) { diff --git a/dyad-2/inc/extras.php b/dyad-2/inc/extras.php index e95623128c..e3c483e22f 100644 --- a/dyad-2/inc/extras.php +++ b/dyad-2/inc/extras.php @@ -33,7 +33,11 @@ function dyad_2_body_classes( $classes ) { } //Has featured image? - if ( ! is_page() && dyad_2_has_post_thumbnail( $post->ID ) && dyad_2_jetpack_featured_image_display() ) { + if ( + ! is_page() + && dyad_2_has_post_thumbnail( $post->ID ?? null ) + && dyad_2_jetpack_featured_image_display() + ) { $classes[] = 'has-post-thumbnail'; } diff --git a/lodestar/components/page/content-front-page-panels.php b/lodestar/components/page/content-front-page-panels.php index 978afc268a..3148ebad65 100644 --- a/lodestar/components/page/content-front-page-panels.php +++ b/lodestar/components/page/content-front-page-panels.php @@ -25,7 +25,10 @@ $thumbnail_attributes = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'lodestar-featured-image' ); //Calculate aspect ratio: h / w * 100% + $ratio = 100; + if ( isset($thumbnail_attributes[2] ) && isset( $thumbnail_attributes[1] ) && $thumbnail_attributes[1] > 0 ) { $ratio = $thumbnail_attributes[2] / $thumbnail_attributes[1] * 100; + } ?>
diff --git a/radcliffe-2/inc/logo-resizer.php b/radcliffe-2/inc/logo-resizer.php index a2954cfc43..4ff170f20f 100644 --- a/radcliffe-2/inc/logo-resizer.php +++ b/radcliffe-2/inc/logo-resizer.php @@ -95,6 +95,9 @@ function logo_awesomeness_customize_logo_resize( $html ) { /* Helper function to determine the max size of the logo */ function logo_awesomeness_min_max( $short, $long, $short_max, $long_max, $percent, $min ){ + $short ??= 1; + $long ??= 1; + $max = []; $size = []; $ratio = ( $long / $short ); diff --git a/seedlet/inc/wpcom.php b/seedlet/inc/wpcom.php index 43982eca16..2faea69c20 100644 --- a/seedlet/inc/wpcom.php +++ b/seedlet/inc/wpcom.php @@ -33,11 +33,11 @@ function seedlet_wpcom_setup() { $wpcom_colors_array = get_theme_mod( 'colors_manager' ); if ( ! empty( $wpcom_colors_array ) ) { - $primary = $wpcom_colors_array['colors']['link']; - $secondary = $wpcom_colors_array['colors']['fg1']; - $foreground = $wpcom_colors_array['colors']['txt']; - $tertiary = $wpcom_colors_array['colors']['fg2']; - $background = $wpcom_colors_array['colors']['bg']; + $primary = $wpcom_colors_array['colors']['link'] ?? ''; + $secondary = $wpcom_colors_array['colors']['fg1'] ?? ''; + $foreground = $wpcom_colors_array['colors']['txt'] ?? ''; + $tertiary = $wpcom_colors_array['colors']['fg2'] ?? ''; + $background = $wpcom_colors_array['colors']['bg'] ?? ''; /** * De-register original editor color palette in favor of the wpcom implementation diff --git a/shoreditch/inc/extras.php b/shoreditch/inc/extras.php index cd37909c72..95c5e15d7d 100644 --- a/shoreditch/inc/extras.php +++ b/shoreditch/inc/extras.php @@ -57,7 +57,7 @@ function shoreditch_background_image() { } else { $image = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'post-thumbnail' ); - $image = $image[0]; + $image = $image[0] ?? null; } if ( ! $image ) {