# blockenberg/2.0.12/blocks/print-button/frontend.js

Blockenberg — 600+ Advanced Gutenberg Blocks &amp; AI Agent for WordPress Block Editor, version 2.0.12. 24 lines.

- Page: https://pluginprobe.com/plugins/blockenberg/2.0.12/code/blocks/print-button/frontend.js
- Raw: https://pluginprobe.com/plugins/blockenberg/2.0.12/raw/blocks/print-button/frontend.js
- Modified: 2026-08-23T11:58:34+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/blockenberg/2.0.12/code/blocks/print-button/frontend.js#L10-L20`.

```javascript
/* Print / PDF Button — frontend */
( function () {
	'use strict';

	function onClick( e ) {
		var btn = e.target.closest( '[data-bkbg-print="1"]' );
		if ( ! btn ) {
			return;
		}
		e.preventDefault();
		window.print();
	}

	function init() {
		document.addEventListener( 'click', onClick );
	}

	if ( document.readyState === 'loading' ) {
		document.addEventListener( 'DOMContentLoaded', init );
	} else {
		init();
	}
}() );

```
