PluginProbe
Gutenberg / trunk
Gutenberg vtrunk
24.1.0 24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 All 404 releases
← All changes | build/scripts/block-library/latest-posts.php +3 -2 23.6.0 → trunk View file →
@@ -57,10 +57,11 @@
57 57
58 58 $block_core_latest_posts_excerpt_length = $attributes['excerptLength'];
59 59 add_filter( 'excerpt_length', 'gutenberg_block_core_latest_posts_get_excerpt_length', 20 );
60 60
61 - if ( ! empty( $attributes['categories'] ) ) {
62 - $args['category__in'] = array_column( $attributes['categories'], 'id' );
61 + $categories = $attributes['categories'] ?? null;
62 + if ( ! empty( $categories ) && is_array( $categories ) ) {
63 + $args['category__in'] = array_column( $categories, 'id' );
63 64 }
64 65 if ( isset( $attributes['selectedAuthor'] ) ) {
65 66 $args['author'] = $attributes['selectedAuthor'];
66 67 }