| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: Icon Separator |
| 4 |
* Description: A simple horizontal separator with icon. |
| 5 |
* Requires at least: 6.5 |
| 6 |
* Requires PHP: 7.0 |
| 7 |
* Version: 1.2.3 |
| 8 |
* Author: Phi Phan |
| 9 |
* Author URI: https://boldblocks.net |
| 10 |
* Plugin URI: https://boldblocks.net?utm_source=Icon+Separator&utm_campaign=visit+site&utm_medium=link&utm_content=Plugin+URI |
| 11 |
* |
| 12 |
* @package IconSeparator |
| 13 |
* @copyright Copyright(c) 2022, Phi Phan |
| 14 |
*/ |
| 15 |
|
| 16 |
namespace IconSeparator; |
| 17 |
|
| 18 |
// Exit if accessed directly. |
| 19 |
defined( 'ABSPATH' ) || exit; |
| 20 |
|
| 21 |
// Define constants. |
| 22 |
define( 'ICON_SEPARATOR_ROOT', __FILE__ ); |
| 23 |
define( 'ICON_SEPARATOR_PATH', trailingslashit( plugin_dir_path( ICON_SEPARATOR_ROOT ) ) ); |
| 24 |
|
| 25 |
/** |
| 26 |
* Registers the block using the metadata loaded from the `block.json` file. |
| 27 |
* Behind the scenes, it registers also all assets so they can be enqueued |
| 28 |
* through the block editor in the corresponding context. |
| 29 |
* |
| 30 |
* @see https://developer.wordpress.org/reference/functions/register_block_type/ |
| 31 |
*/ |
| 32 |
function icon_separator_block_init() { |
| 33 |
register_block_type( __DIR__ . '/build' ); |
| 34 |
} |
| 35 |
add_action( 'init', __NAMESPACE__ . '\\icon_separator_block_init' ); |
| 36 |
|
| 37 |
// Load icons library. |
| 38 |
require_once __DIR__ . '/includes/icon-library.php'; |
| 39 |
|