Server IP : 170.150.155.74 / Your IP : 3.15.220.148 Web Server : Apache/2.4.53 (Debian) System : Linux b22bf132354b 5.4.0-162-generic #179-Ubuntu SMP Mon Aug 14 08:51:31 UTC 2023 x86_64 User : www-data ( 33) PHP Version : 7.4.29 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/src/wordpress/wp-includes/blocks/ |
Upload File : |
<?php /** * Server-side rendering of the `core/file` block. * * @package WordPress */ /** * When the `core/file` block is rendering, check if we need to enqueue the `'wp-block-file-view` script. * * @param array $attributes The block attributes. * @param array $content The block content. * * @return string Returns the block content. */ function render_block_core_file( $attributes, $content ) { $should_load_view_script = ! empty( $attributes['displayPreview'] ) && ! wp_script_is( 'wp-block-file-view' ); if ( $should_load_view_script ) { wp_enqueue_script( 'wp-block-file-view' ); } return $content; } /** * Registers the `core/file` block on server. */ function register_block_core_file() { register_block_type_from_metadata( __DIR__ . '/file', array( 'render_callback' => 'render_block_core_file', ) ); } add_action( 'init', 'register_block_core_file' );