| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: Pdf Embed |
| 4 |
* Plugin URI: https://formello.net/ |
| 5 |
* Description: PDF embedded with official Adobe API. |
| 6 |
* Version: 0.1.4 |
| 7 |
* Author: Formello |
| 8 |
* Author URI: https://formello.net |
| 9 |
* License: GPL2 |
| 10 |
* License URI: https://www.gnu.org/licenses/gpl-2.0.html |
| 11 |
* Text Domain: formello |
| 12 |
* @package Formello/PdfEmbed |
| 13 |
* |
| 14 |
*/ |
| 15 |
|
| 16 |
/** |
| 17 |
* Registers the block using the metadata loaded from the `block.json` file. |
| 18 |
* Behind the scenes, it registers also all assets so they can be enqueued |
| 19 |
* through the block editor in the corresponding context. |
| 20 |
* |
| 21 |
* @see https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/writing-your-first-block-type/ |
| 22 |
*/ |
| 23 |
function pdf_embed_block_init() { |
| 24 |
|
| 25 |
register_block_type_from_metadata( |
| 26 |
__DIR__, |
| 27 |
); |
| 28 |
} |
| 29 |
add_action( 'init', 'pdf_embed_block_init' ); |
| 30 |
|
| 31 |
function pdf_embed_setting() { |
| 32 |
$args = array( |
| 33 |
'type' => 'string', |
| 34 |
'sanitize_callback' => 'sanitize_text_field', |
| 35 |
'default' => '', |
| 36 |
'show_in_rest' => true, |
| 37 |
); |
| 38 |
register_setting( 'embed_pdf', 'embed_pdf_api_key', $args ); |
| 39 |
} |
| 40 |
add_action( 'init', 'pdf_embed_setting' ); |
| 41 |
|