'pinfesta_render_block' ) ); // The editor strings live in JavaScript, so they need their own JSON // catalogue. The handle is read back from the registered block instead of // being guessed: WordPress builds it from block.json and it can change. if ( $type && ! empty( $type->editor_script_handles ) ) { foreach ( $type->editor_script_handles as $handle ) { wp_set_script_translations( $handle, 'piazza-in-festa', PINFESTA_DIR . 'languages' ); } } } add_action( 'init', 'pinfesta_register_block' ); /** * Renders the block on the front end and in the editor preview. * * @param array $attributes Block attributes. * @return string HTML. */ function pinfesta_render_block( $attributes ) { $args = wp_parse_args( (array) $attributes, pinfesta_defaults() ); $html = pinfesta_render_iframe( $args ); if ( '' === $html ) { return ''; } $wrapper = get_block_wrapper_attributes(); return '