Make WordPress Core

Changeset 53211


Ignore:
Timestamp:
04/19/2022 09:56:02 AM (3 years ago)
Author:
gziolo
Message:

Code Quality: Fix reported undefined $script_uri variable notice

The code editor reported this issue while mamduka was browsing the blocks.php file. PHP considers variables undefined until a value is assigned (or the global keyword is used).

Follow-up for [53091].
Props mamaduka, peterwilsoncc.
See 55567.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks.php

    r53197 r53211  
    114114    $is_theme_block   = 0 === strpos( $script_path_norm, $theme_path_norm );
    115115
    116     $script_uri;
     116    $script_uri = plugins_url( $script_path, $metadata['file'] );
    117117    if ( $is_core_block ) {
    118118        $script_uri = includes_url( str_replace( $wpinc_path_norm, '', $script_path_norm ) );
    119119    } elseif ( $is_theme_block ) {
    120120        $script_uri = get_theme_file_uri( str_replace( $theme_path_norm, '', $script_path_norm ) );
    121     } else {
    122         $script_uri = plugins_url( $script_path, $metadata['file'] );
    123121    }
    124122
Note: See TracChangeset for help on using the changeset viewer.