Skip to content

Using new wp_register_block_types_from_metadata_collection in PHP 8.2 produces warning #70332

@Lovor01

Description

@Lovor01

Description

When registering blocks with wp_register_block_types_from_metadata_collection and WP_DEBUG is set to true, a following warning is produced:

PHP Deprecated: dirname(): Passing null to parameter #1 ($path) of type string is deprecated ...

Step-by-step reproduction instructions

Set PHP to 8.2 version (probably the same with above versions)
Change multiple block registration to above function
Set 'WP_DEBUG to true in wp-config.php

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] BlocksOverall functionality of blocks[Status] Needs More InfoFollow-up required in order to be actionable.[Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions