'pinfesta_render_block' ) ); // The editor strings live in JavaScript, so they need their own JSON // catalogue: wordpress.org builds it from translate.wordpress.org and drops // it in the languages folder of the site, which is where WordPress looks // when no path is passed. 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' ); } } } 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 '