浏览代码

pub themes: Restore changes overwritten from latest themes deploy (D144213 D144218 D144223 D144228 D144234 D144240 D144244) (#7708)

Matthew Reishus 1 年之前
父节点
当前提交
836413ef04

+ 1 - 1
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 ) {

+ 5 - 1
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';
 	}
 

+ 3 - 0
lodestar/components/page/content-front-page-panels.php

@@ -25,7 +25,10 @@ $panel_layout = get_theme_mod( $current_panel_layout, 'one-column' );
 
 		$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;
+		}
 		?>
 
 		<div class="panel-image" style="background-image: url(<?php echo esc_url( $thumbnail[0] ); ?>);">

+ 3 - 0
radcliffe-2/inc/logo-resizer.php

@@ -95,6 +95,9 @@ add_filter( 'get_custom_logo', 'logo_awesomeness_customize_logo_resize' );
 
 /* 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 );

+ 5 - 5
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

+ 1 - 1
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 ) {