Make WordPress Core


Ignore:
Timestamp:
09/29/2025 04:28:00 PM (11 months ago)
Author:
swissspidy
Message:

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

Addresses a new deprecation in PHP 8.5.

Props swissspidy.
Fixes #63957.

File:
1 edited

Legend:

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

    r60804 r60809  
    135135         * @since 5.0.0
    136136         *
    137          * @param string $name Block type name including namespace.
     137         * @param string|null $name Block type name including namespace.
    138138         * @return WP_Block_Type|null The registered block type, or null if it is not registered.
    139139         */
     
    162162         * @since 5.0.0
    163163         *
    164          * @param string $name Block type name including namespace.
     164         * @param string|null $name Block type name including namespace.
    165165         * @return bool True if the block type is registered, false otherwise.
    166166         */
    167167        public function is_registered( $name ) {
    168                 return isset( $this->registered_block_types[ $name ] );
     168                return isset( $name, $this->registered_block_types[ $name ] );
    169169        }
    170170
Note: See TracChangeset for help on using the changeset viewer.