Making WordPress.org

Changeset 11291


Ignore:
Timestamp:
10/22/2021 06:36:17 PM (3 years ago)
Author:
ryelle
Message:

Plugin Directory: Skip core/* blocks when detecting the blocks a plugin provides.

This prevents block directory plugins from indicating that they offer core blocks, which can incorrectly be returned by the block directory API when trying to find "missing blocks".

See #5910.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/class-import.php

    r11238 r11291  
    637637            }
    638638        }
     639
     640        // Remove any core blocks from the block list.
     641        $blocks = array_filter(
     642            $blocks,
     643            function( $block_name ) {
     644                return 0 !== strpos( $block_name, 'core/' );
     645            },
     646            ARRAY_FILTER_USE_KEY
     647        );
    639648
    640649        // Filter the blocks list so that the parent block is first.
Note: See TracChangeset for help on using the changeset viewer.