PluginProbe
Vayu Blocks – Website Builder for the Gutenberg Block Editor / 1.4.2
Vayu Blocks – Website Builder for the Gutenberg Block Editor v1.4.2
trunk 1.0.3 1.0.4 1.0.5 1.0.6 1.0.8 1.0.9 1.1.0 1.1.1 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.10 1.3.11 1.3.2 1.3.3 1.3.4 1.3.5 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 All 29 releases
vayu-blocks / vayu-blocks.php

vayu-blocks.php in Vayu Blocks – Website Builder for the Gutenberg Block Editor 1.4.2, at vayu-blocks.php

142 lines 3.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: Vayu Blocks
4 * Plugin URI: https://themehunk.com/vayu-blocks
5 * Description: The Vayu Blocks is an add-on plugin For Gutenberg Block Editor. Quickstart the Gutenberg editor with Powerful and elegant blocks to design stunning websites. Free Vayu Blocks plugin that amplifies the default WordPress Gutenberg Editor with powerful blocks.
6 * Requires at least: 6.2
7 * Requires PHP: 7.4
8 * Version: 1.4.2
9 * Author: ThemeHunk
10 * Author URI: https://themehunk.com
11 * License: GPLv3
12 * License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
13 * Text Domain: vayu-blocks
14 *
15 * @package vayu-blocks
16 */
17
18 if ( ! defined( 'ABSPATH' ) ) {
19 exit;
20 }
21 define( 'VAYU_BLOCKS_VERSION', '1.4.2' );
22 define( 'VAYU_BLOCKS_BASEFILE', __FILE__ );
23 define( 'VAYU_BLOCKS_URL', plugins_url( '/', __FILE__ ) );
24 define( 'VAYU_BLOCKS_PATH', dirname( __FILE__ ) );
25 define( 'VAYU_BLOCKS_DIR_PATH', plugin_dir_path( __FILE__ ) );
26 define( 'VAYU_BLOCKS_PRO_SUPPORT', true );
27 define( 'VAYU_BLOCKS_SHOW_NOTICES', false );
28
29
30 class Vayu_Block_Plugin {
31
32 /**
33 * Plugin version.
34 *
35 * @var string
36 */
37 const VERSION = VAYU_BLOCKS_VERSION;
38
39 /**
40 * Initialize the plugin.
41 */
42
43 public function __construct() {
44
45 require_once VAYU_BLOCKS_DIR_PATH .'inc/init.php';
46 require_once VAYU_BLOCKS_DIR_PATH .'public/init.php';
47 add_action('admin_menu', array( $this, 'vayu_plugin_menu'));
48
49 }
50
51
52 // plugin menu option add
53 public function vayu_plugin_menu() {
54 add_menu_page(
55 'Vayu Blocks',
56 'Vayu Blocks',
57 'manage_options',
58 'vayu-blocks',
59 array( $this, 'vayu_plugin_page_callback' ),
60 plugins_url( 'vayu-blocks/inc/assets/img/menu-logo.png' ),
61 59
62 );
63
64 add_submenu_page(
65 'vayu-blocks',
66 'Blocks',
67 'Blocks',
68 'manage_options',
69 'vayu-blocks',
70 array( $this, 'vayu_plugin_page_callback' ),
71 );
72
73 add_submenu_page(
74 'vayu-blocks',
75 'Settings',
76 'Settings',
77 'manage_options',
78 'vayu-blocks-settings',
79 array( $this, 'vayu_plugin_page_callback' )
80 );
81
82 add_submenu_page(
83 'vayu-blocks',
84 'Starter Templates',
85 'Starter Templates',
86 'manage_options',
87 'vayu-sites',
88 array( $this, 'vayu_plugin_page_callback' )
89 );
90
91 }
92
93 public function vayu_blocks_sites_callback() {
94 ?>
95 <div class="themehunk-sites-menu-page-wrapper">
96 <div id="vayuroot"></div>
97 </div>
98 <?php
99 }
100
101 public function vayu_plugin_page_callback() {
102
103 if ( ! current_user_can( 'manage_options' ) ) {
104 return;
105 }?>
106
107 <div class="vayu-blocks-wrap">
108 <div id="vayu-blocks-container"></div>
109 </div>
110
111 <?php }
112
113 }
114
115
116 function vayu_block_plugin_init() {
117 new Vayu_Block_Plugin();
118 }
119 add_action( 'init', 'vayu_block_plugin_init', 1 );
120
121
122
123
124 /**
125 * Adds a custom template part area for mega menus to the list of template part areas.
126 *
127 * @param array $areas Existing array of template part areas.
128 * @return array Modified array of template part areas including the new "Menu" area.
129 */
130 function vayu_blocks_mega_menu_template_part_areas( array $areas ) {
131 $areas[] = array(
132 'area' => 'menu',
133 'area_tag' => 'div',
134 'description' => __( 'Menu templates are used to create sections of a mega menu.', 'mega-menu-block' ),
135 'icon' => '',
136 'label' => __( 'Menu', 'mega-menu-block' ),
137 );
138
139 return $areas;
140 }
141 // add_filter( 'default_wp_template_part_areas', 'vayu_blocks_mega_menu_template_part_areas' );
142 // require_once VAYU_BLOCKS_DIR_PATH .'inc/patterns/single.php';