# gutenberg/9.7.0/lib/widget-preview-template.php

Gutenberg, version 9.7.0. 45 lines.

- Page: https://pluginprobe.com/plugins/gutenberg/9.7.0/code/lib/widget-preview-template.php
- Raw: https://pluginprobe.com/plugins/gutenberg/9.7.0/raw/lib/widget-preview-template.php
- Modified: 2020-10-21T05:52:32+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/gutenberg/9.7.0/code/lib/widget-preview-template.php#L10-L20`.

```php
<?php
/**
 * Start: Include for phase 2
 * Template used to render widget previews.
 *
 * @package gutenberg
 * @since 5.4.0
 */

if ( ! function_exists( 'wp_head' ) ) {
	exit;
}
?>
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
	<meta charset="<?php bloginfo( 'charset' ); ?>" />
	<meta name="viewport" content="width=device-width, initial-scale=1" />
	<link rel="profile" href="https://gmpg.org/xfn/11" />
	<?php wp_head(); ?>
	<style>
		/* Reset theme styles */
		html, body, #page, #content {
			background: #FFF !important;
			padding: 0 !important;
			margin: 0 !important;
		}
	</style>
</head>

<body <?php body_class(); ?>>
<div id="page" class="site">
	<div id="content" class="site-content">
		<?php
		$registry = WP_Block_Type_Registry::get_instance();
		$block    = $registry->get_registered( 'core/legacy-widget' );
		echo $block->render( $_GET['widget-preview'] );
		?>
	</div><!-- #content -->
</div><!-- #page -->

<?php wp_footer(); ?>
</body>
</html>

```
