Generating a QRcode for the permalink (which strips the ?print query string)
This commit is contained in:
1 parent
e4ed3d3dcb
commit
11e1c64d9d
5 files changed
+30
-11
No files matched your search
@@ -1,8 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* vim: set ai sw=4 smarttab expandtab: tabstop=8 softtabstop=0
|
||||
*
|
||||
* @see https://github.com/WordPress/gutenberg/blob/trunk/docs/reference-guides/block-api/block-metadata.md#render
|
||||
*/
|
||||
?>
|
||||
<p <?php echo get_block_wrapper_attributes(); ?>>
|
||||
<?php esc_html_e( 'Printable QR code – hello from a dynamic block!', 'wp-printable-qrcode' ); ?>
|
||||
</p>
|
||||
<div <?php echo get_block_wrapper_attributes(); ?>>
|
||||
<?php
|
||||
|
||||
//error_log('PHP: rendering printable QRcode, $_SERVER: '.print_r($_SERVER, true), 0);
|
||||
//error_log('PHP: rendering printable QRcode, get_permalink(): '.print_r(get_permalink(), true), 0);
|
||||
|
||||
echo do_shortcode("[kaya_qrcode title_align='alignnone' content='".
|
||||
get_permalink().
|
||||
"' ecclevel='M' size='100' border='1' color='#000000' bgcolor='#FFFFFF' align='alignnone' download_align='alignnone']");
|
||||
|
||||
?>
|
||||
</div>
|
||||
@@ -1 +1 @@
|
||||
.wp-block-wppqr-wp-printable-qrcode{background-color:#21759b;color:#fff;padding:2px}
|
||||
|
||||
@@ -1 +1 @@
|
||||
.wp-block-wppqr-wp-printable-qrcode{background-color:#21759b;color:#fff;padding:2px}
|
||||
|
||||
Reference in new issue
Block a user