-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvideo-lightbox-for-guten-blocks.php
99 lines (88 loc) · 2.64 KB
/
video-lightbox-for-guten-blocks.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
91
92
93
94
95
96
97
98
99
<?php
/**
* Plugin Name: Video Lightbox For Guten Blocks
* Description: Enhance your WordPress website with the "Video Lightbox for Gutenberg Blocks" plugin, a powerful tool that seamlessly integrates into the Gutenberg editor to bring a captivating multimedia experience to your content.
* Requires at least: 5.9
* Requires PHP: 7.4
* Version: 1.0.2
* Author: ZealousWeb
* Author URI: https://www.zealousweb.com
* License: GNU General Public License v3.0 or later
* License URI: https://spdx.org/licenses/GPL-3.0-or-later.html
* Text Domain: video-lightbox-for-guten-blocks
*
* @category ZealBlocks
* @package Video-Lightbox-for-Guten-Blocks
* @author ZealousWeb <support@zealousweb.com>
* @copyright 2024 ZealousWeb
* @license GNU General Public License v3.0 or later
* @link https://spdx.org/licenses/GPL-3.0-or-later.html
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
if (!defined('ZWT_VLFGB_VERSION')) {
define('ZWT_VLFGB_VERSION', '1.0.2');
}
/**
* Register block assets.
*
* @return void
*/
function ZWT_VLFGB_init(){
wp_enqueue_script(
'zwt-vlfgb-fancybox-library-js',
plugins_url('/assets/js/fancybox.umd.js', __FILE__),
array('jquery'),
'5.0.24',
false
);
wp_enqueue_style(
'zwt-vlfgb-fancybox-liblibrary-css',
plugins_url('/assets/css/fancybox.css', __FILE__),
'',
'5.0.24',
''
);
// wp_enqueue_script(
// 'zwt-vlfgb-custom-js',
// plugins_url('/assets/js/scripts.js', __FILE__),
// array('jquery', 'zwt-vlfgb-fancybox-library-js'),
// '',
// false
// );
/** Custom Plugin Style */
wp_enqueue_style(
'front-styles',
plugins_url('/build/style-index.css', __FILE__),
ZWT_VLFGB_VERSION,
true
);
/** Register Block */
register_block_type(__DIR__ . '/build');
}
add_action('init', 'ZWT_VLFGB_init');
/**
* Category Creation function
*
* @param array $categories - list of category.
*
* @return mixed Return description.
*/
function ZWT_VLFGB_Categories( $categories )
{
if (array_search('zealblocks', array_column($categories, 'slug'), true) === false) {
return array_merge(
$categories,
array(
array(
'slug' => 'zealblocks',
'title' => __('ZealBlocks', 'videolightboxforgutenberg'),
'icon' => '',
),
)
);
}
return $categories;
}
add_action('block_categories_all', 'ZWT_VLFGB_Categories', 10, 2);