Make WordPress Core


Ignore:
Timestamp:
06/30/2021 02:13:30 AM (4 years ago)
Author:
desrosj
Message:

Build/Test Tools: Revert [51259-51256,51265].

[51259] introduced a PHP notice that was not actually fixed by [51265]. Reverting these changes in order to investigate further.

See #53397.

File:
1 edited

Legend:

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

    r51267 r51268  
    4343            $asset_handle .= '-editor';
    4444        }
    45         if ( 0 === strpos( $field_name, 'view' ) ) {
    46             $asset_handle .= '-view';
    47         }
    4845        return $asset_handle;
    4946    }
     
    5249        'editorScript' => 'editor-script',
    5350        'script'       => 'script',
    54         'viewScript'   => 'view-script',
    5551        'editorStyle'  => 'editor-style',
    5652        'style'        => 'style',
     
    106102        return false;
    107103    }
    108     $is_core_block       = isset( $metadata['file'] ) && 0 === strpos( $metadata['file'], ABSPATH . WPINC );
    109     $script_uri          = $is_core_block ?
    110         includes_url( str_replace( ABSPATH . WPINC, '', realpath( dirname( $metadata['file'] ) . '/' . $script_path ) ) ) :
    111         plugins_url( $script_path, $metadata['file'] );
    112     $script_asset        = require $script_asset_path;
    113     $script_dependencies = isset( $script_asset['dependencies'] ) ? $script_asset['dependencies'] : array();
    114     $result              = wp_register_script(
     104    $script_asset = require $script_asset_path;
     105    $result       = wp_register_script(
    115106        $script_handle,
    116         $script_uri,
    117         $script_dependencies,
    118         isset( $script_asset['version'] ) ? $script_asset['version'] : false
     107        plugins_url( $script_path, $metadata['file'] ),
     108        $script_asset['dependencies'],
     109        $script_asset['version']
    119110    );
    120111    if ( ! $result ) {
     
    122113    }
    123114
    124     if ( ! empty( $metadata['textdomain'] ) && in_array( 'wp-i18n', $script_dependencies ) ) {
     115    if ( ! empty( $metadata['textdomain'] ) ) {
    125116        wp_set_script_translations( $script_handle, $metadata['textdomain'] );
    126117    }
     
    321312    }
    322313
    323     if ( ! empty( $metadata['viewScript'] ) ) {
    324         $settings['view_script'] = register_block_script_handle(
    325             $metadata,
    326             'viewScript'
    327         );
    328     }
    329 
    330314    if ( ! empty( $metadata['editorStyle'] ) ) {
    331315        $settings['editor_style'] = register_block_style_handle(
Note: See TracChangeset for help on using the changeset viewer.