-
Notifications
You must be signed in to change notification settings - Fork 0
/
gutenwatch-video-lightbox.php
90 lines (76 loc) · 2.4 KB
/
gutenwatch-video-lightbox.php
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
/**
* Plugin Name: Gutenwatch Video Lightbox
* Description: Gutenwatch Video Lightbox: A sleek, user-friendly plugin for displaying videos in a stylish pop-up box.
* Requires at least: 6.1
* Requires PHP: 7.0
* Version: 1.0
* Author: ZealousWeb
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: gutenwatch-video-lightbox
*
* @category ZealousWeb
* @package gutenwatch-video-lightbox
* @author zealousweb <[email protected]>
* @copyright 2023 zealousweb
* @license https://github.com/pjreddie/darknet/blob/master/LICENSE.gpl GPL-2.0+
* @link http://www.zealousweb.com/
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! defined( 'ZWT_GVL_BLOCKS_FILE' ) ) {
define( 'ZWT_GVL_BLOCKS_FILE', __FILE__ );
}
if ( ! defined( 'ZWT_GVL_BLOCKS_DIR' ) ) {
define( 'ZWT_GVL_BLOCKS_DIR', dirname( __FILE__ ) );
}
if ( ! defined( 'ZWT_GVL_BLOCKS_ROOT' ) ) {
define( 'ZWT_GVL_BLOCKS_ROOT', dirname( plugin_basename( ZWT_GVL_BLOCKS_FILE ) ) );
}
if ( ! defined( 'ZWT_GVL_BLOCK_PLUGIN_NAME' ) ) {
define( 'ZWT_GVL_BLOCK_PLUGIN_NAME', 'ZWT GVL Blocks' );
}
if ( ! defined( 'ZWT_GVL_BLOCKS_VERSION' ) ) {
define( 'ZWT_GVL_BLOCKS_VERSION', time() );
}
if ( ! defined( 'ZWT_GVL_BLOCKS_VERSION' ) ) {
define( 'ZWT_GVL_BLOCK_PLUGIN_SHORT_NAME', 'GVL' );
}
/**
* Add category in blocks lists.
*
* @param array $categories - get category array.
* @return array
*/
function zwt_gvl_plugin_block_categories( $categories ) {
if ( array_search( 'zwt-blocks', array_column( $categories, 'slug' ), true ) === false ) {
return array_merge(
$categories,
array(
array(
'slug' => 'zwt-blocks',
'title' => __( 'Zeal Blocks', 'gutenwatch-video-lightbox' ),
'icon' => '',
),
)
);
}
return $categories;
}
add_action( 'block_categories_all', 'zwt_gvl_plugin_block_categories', 10, 2 );
function zwt_gutenwatch_video_lightbox_block_init() {
// Register LightBox CSS and JS.
register_block_type(
'zwt-gvl-blocks/gutenwatch-video-lightbox',
array(
'style' => 'zwt_gvl_blocks-style-css',
'style-comman' => 'zwt_gvl_blocks-comman-style-css',
'editor_script' => 'zwt_gvl_blocks-block-js',
'editor_style' => 'zwt_gvl_blocks-block-editor-css',
)
);
}
add_action( 'init', 'zwt_gutenwatch_video_lightbox_block_init' );