wp/wp-includes/blocks/file.php
changeset 19 3d72ae0968f4
parent 18 be944660c56a
child 21 48c4eec2b7e6
equal deleted inserted replaced
18:be944660c56a 19:3d72ae0968f4
     6  */
     6  */
     7 
     7 
     8 /**
     8 /**
     9  * When the `core/file` block is rendering, check if we need to enqueue the `'wp-block-file-view` script.
     9  * When the `core/file` block is rendering, check if we need to enqueue the `'wp-block-file-view` script.
    10  *
    10  *
    11  * @param array $attributes The block attributes.
    11  * @param array  $attributes The block attributes.
    12  * @param array $content    The block content.
    12  * @param string $content    The block content.
    13  *
    13  *
    14  * @return string Returns the block content.
    14  * @return string Returns the block content.
    15  */
    15  */
    16 function render_block_core_file( $attributes, $content ) {
    16 function render_block_core_file( $attributes, $content ) {
    17 	$should_load_view_script = ! empty( $attributes['displayPreview'] ) && ! wp_script_is( 'wp-block-file-view' );
    17 	$should_load_view_script = ! empty( $attributes['displayPreview'] ) && ! wp_script_is( 'wp-block-file-view' );