Skip to content

Commit 220bf6b

Browse files
fix: default values
1 parent 1dd13e0 commit 220bf6b

3 files changed

Lines changed: 10 additions & 15 deletions

File tree

includes/gutenberg/feedzy-rss-feeds-loop-block.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ public function render_callback( $attributes, $content ) {
139139
'target' => '_blank',
140140
'keywords_ban' => '',
141141
'columns' => '1',
142-
'thumb' => $thumb,
143-
'default' => $default_thumbnail_img,
142+
'thumb' => 'no',
143+
'default' => '',
144144
'title' => '',
145145
'meta' => 'yes',
146146
'multiple_meta' => 'no',
@@ -297,7 +297,7 @@ private function get_thumbnail( $item, $attributes ) {
297297
return $item['item_img_path'];
298298
}
299299

300-
if ( 'yes' !== $thumb ) {
300+
if ( 'auto' === $thumb ) {
301301
return '';
302302
}
303303

@@ -311,7 +311,12 @@ private function get_thumbnail( $item, $attributes ) {
311311
isset( $settings, $settings['general'], $settings['general']['default-thumbnail-id'] ) &&
312312
! empty( $settings['general']['default-thumbnail-id'] )
313313
) {
314-
return wp_get_attachment_image_src( $settings['general']['default-thumbnail-id'], 'full' );
314+
$media_img = wp_get_attachment_image_src( $settings['general']['default-thumbnail-id'], 'full' );
315+
if (
316+
is_array( $media_img ) && ! empty( $media_img[0] )
317+
) {
318+
return $media_img[0];
319+
}
315320
}
316321

317322
return FEEDZY_ABSURL . 'img/feedzy.svg';

js/FeedzyLoop/block.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
},
5858
"thumb": {
5959
"type": "string",
60-
"default": "auto"
60+
"default": "yes"
6161
},
6262
"fallbackImage": {
6363
"type": "object"

phpstan-baseline.neon

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,21 +1635,11 @@ parameters:
16351635
count: 1
16361636
path: includes/gutenberg/feedzy-rss-feeds-loop-block.php
16371637

1638-
-
1639-
message: "#^Method Feedzy_Rss_Feeds_Loop_Block\\:\\:get_value\\(\\) has parameter \\$item with no value type specified in iterable type array\\.$#"
1640-
count: 1
1641-
path: includes/gutenberg/feedzy-rss-feeds-loop-block.php
1642-
16431638
-
16441639
message: "#^Method Feedzy_Rss_Feeds_Loop_Block\\:\\:register_block\\(\\) has no return type specified\\.$#"
16451640
count: 1
16461641
path: includes/gutenberg/feedzy-rss-feeds-loop-block.php
16471642

1648-
-
1649-
message: "#^Method Feedzy_Rss_Feeds_Loop_Block\\:\\:render_callback\\(\\) has parameter \\$attributes with no value type specified in iterable type array\\.$#"
1650-
count: 1
1651-
path: includes/gutenberg/feedzy-rss-feeds-loop-block.php
1652-
16531643
-
16541644
message: "#^Offset 1 on array\\{string, non\\-empty\\-string\\} in isset\\(\\) always exists and is not nullable\\.$#"
16551645
count: 1

0 commit comments

Comments
 (0)