PluginProbe
bBlocks – Essential Gutenberg Blocks & Patterns Collection / trunk
bBlocks – Essential Gutenberg Blocks & Patterns Collection vtrunk
2.1.6 2.1.5 2.1.4 2.1.3 2.1.2 2.1.1 2.1.0 2.0.43 2.0.42 2.0.41 2.0.40 2.0.39 2.0.38 trunk 1.0 1.1 1.2 1.3 1.4 1.5 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 All 106 releases
b-blocks / build / qr-code / render.php

render.php in bBlocks – Essential Gutenberg Blocks & Patterns Collection trunk, at build/qr-code/render.php

24 lines 943 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 $prefix = 'bBlocksQRCode';
3 $id = wp_unique_id( "$prefix-" );
4 $planClass = BBlocks\Inc\Utils::isPro() ? 'pro' : 'free';
5
6 extract( $attributes );
7 $qrStyles = "#$id .$prefix{ text-align: $qrAlign; }";
8 $siteUrl = $url ? $url : 'https://bplugins.com';
9
10 $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";
11 ?>
12 <div
13 <?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- get_block_wrapper_attributes() is properly escaped ?>
14 <?php echo get_block_wrapper_attributes( [ 'class' => $planClass ] ); ?>
15 id='<?php echo esc_attr( $id ); ?>'
16 >
17 <style>
18 <?php echo esc_html( $qrStyles ); ?>
19 </style>
20
21 <div class='<?php echo esc_attr( $prefix ); ?>'>
22 <img src='<?php echo esc_url( $qrUrl ); ?>' alt='<?php echo esc_url( $url ); ?>' />
23 </div>
24 </div>