-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin.php
More file actions
37 lines (34 loc) · 859 Bytes
/
plugin.php
File metadata and controls
37 lines (34 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
/**
* Plugin Name: Template WP Plugin Blocks
* Description: A clean and minimal WordPress Plugin with block.
* Version: 0.1.0
* Requires at least: 6.9
* Requires PHP: 8.3
* Author: Micha Krapp
* License: GPLv2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: template-wp-plugin-blocks
*
* @package TemplateWpPluginBlocks
*/
if ( ! defined( 'ABSPATH' ) ) {
exit();
}
/**
* Register the block.
*/
if ( ! function_exists( 'mfgmicha_block_init' ) ) {
/**
* Initialize blocks.
*
* @return void
*/
function mfgmicha_block_init(): void {
wp_register_block_types_from_metadata_collection(
plugin_dir_path( __FILE__ ) . 'build',
plugin_dir_path( __FILE__ ) . 'build/blocks-manifest.php',
);
}
}
add_action( 'init', 'mfgmicha_block_init' );