equal
deleted
inserted
replaced
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' ); |