# b-blocks/2.1.2/build/qr-code/render.php

bBlocks – Essential Gutenberg Blocks &amp; Patterns Collection, version 2.1.2. 24 lines.

- Page: https://pluginprobe.com/plugins/b-blocks/2.1.2/code/build/qr-code/render.php
- Raw: https://pluginprobe.com/plugins/b-blocks/2.1.2/raw/build/qr-code/render.php
- Modified: 2026-08-24T10:46:44+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/b-blocks/2.1.2/code/build/qr-code/render.php#L10-L20`.

```php
<?php
$prefix = 'bBlocksQRCode';
$id = wp_unique_id( "$prefix-" );
$planClass = BBlocks\Inc\Utils::isPro() ? 'pro' : 'free';

extract( $attributes );
$qrStyles = "#$id .$prefix{ text-align: $qrAlign; }";
$siteUrl = $url ? $url : 'https://bplugins.com';

$qrUrl = "https://api.qrserver.com/v1/create-qr-code/?size=$dimension"."x"."$dimension&color=". str_replace( '#', '', $color ) ."&bgcolor=". str_replace( '#', '', $bgColor ) ."&ecc=L&qzone=1&data=$siteUrl";
?>
<div
	<?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- get_block_wrapper_attributes() is properly escaped ?>
	<?php echo get_block_wrapper_attributes( [ 'class' => $planClass ] ); ?>
	id='<?php echo esc_attr( $id ); ?>'
>
	<style>
		<?php echo esc_html( $qrStyles ); ?>
	</style>

	<div class='<?php echo esc_attr( $prefix ); ?>'>
		<img src='<?php echo esc_url( $qrUrl ); ?>' alt='<?php echo esc_url( $url ); ?>' />
	</div>
</div>
```
