Make WordPress Core


Ignore:
Timestamp:
10/06/2025 11:29:14 AM (14 months ago)
Author:
swissspidy
Message:

Code Modernization: Fix instances of using null as an array offset.

Addresses a new ​deprecation in PHP 8.5 in several block-related registry classes.

Follow-up to [60809].

Props mukesh27, swissspidy.
Fixes #63957.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-block-styles-registry.php

    r60275 r60904  
    182182         * @since 5.3.0
    183183         *
    184          * @param string $block_name       Block type name including namespace.
    185          * @param string $block_style_name Block style name.
     184         * @param string|null $block_name       Block type name including namespace.
     185         * @param string|null $block_style_name Block style name.
    186186         * @return bool True if the block style is registered, false otherwise.
    187187         */
    188188        public function is_registered( $block_name, $block_style_name ) {
    189                 return isset( $this->registered_block_styles[ $block_name ][ $block_style_name ] );
     189                return isset( $block_name, $block_style_name, $this->registered_block_styles[ $block_name ][ $block_style_name ] );
    190190        }
    191191
Note: See TracChangeset for help on using the changeset viewer.