PluginProbe
Vayu Blocks – Website Builder for the Gutenberg Block Editor / trunk
Vayu Blocks – Website Builder for the Gutenberg Block Editor vtrunk
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 trunk, at vayu-blocks.php

143 lines 4.0 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.0
8 * Version: 1.4.8
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.8' );
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 require_once VAYU_BLOCKS_DIR_PATH .'inc/deactivate-feedback.php';
48 add_action('admin_menu', array( $this, 'vayu_plugin_menu'));
49
50 }
51
52
53 // plugin menu option add
54 public function vayu_plugin_menu() {
55 add_menu_page(
56 'Vayu Blocks',
57 'Vayu Blocks',
58 'manage_options',
59 'vayu-blocks',
60 array( $this, 'vayu_plugin_page_callback' ),
61 plugins_url( 'vayu-blocks/inc/assets/img/menu-logo.png' ),
62 59
63 );
64
65 add_submenu_page(
66 'vayu-blocks',
67 'Blocks',
68 'Blocks',
69 'manage_options',
70 'vayu-blocks',
71 array( $this, 'vayu_plugin_page_callback' ),
72 );
73
74 add_submenu_page(
75 'vayu-blocks',
76 'Settings',
77 'Settings',
78 'manage_options',
79 'vayu-blocks-settings',
80 array( $this, 'vayu_plugin_page_callback' )
81 );
82
83 add_submenu_page(
84 'vayu-blocks',
85 'Starter Templates',
86 'Starter Templates',
87 'manage_options',
88 'vayu-sites',
89 array( $this, 'vayu_plugin_page_callback' )
90 );
91
92 }
93
94 public function vayu_blocks_sites_callback() {
95 ?>
96 <div class="themehunk-sites-menu-page-wrapper">
97 <div id="vayuroot"></div>
98 </div>
99 <?php
100 }
101
102 public function vayu_plugin_page_callback() {
103
104 if ( ! current_user_can( 'manage_options' ) ) {
105 return;
106 }?>
107
108 <div class="vayu-blocks-wrap">
109 <div id="vayu-blocks-container"></div>
110 </div>
111
112 <?php }
113
114 }
115
116
117 function vayu_block_plugin_init() {
118 new Vayu_Block_Plugin();
119 }
120 add_action( 'init', 'vayu_block_plugin_init', 1 );
121
122
123
124
125 /**
126 * Adds a custom template part area for mega menus to the list of template part areas.
127 *
128 * @param array $areas Existing array of template part areas.
129 * @return array Modified array of template part areas including the new "Menu" area.
130 */
131 function vayu_blocks_mega_menu_template_part_areas( array $areas ) {
132 $areas[] = array(
133 'area' => 'menu',
134 'area_tag' => 'div',
135 'description' => __( 'Menu templates are used to create sections of a mega menu.', 'mega-menu-block' ),
136 'icon' => '',
137 'label' => __( 'Menu', 'mega-menu-block' ),
138 );
139
140 return $areas;
141 }
142 // add_filter( 'default_wp_template_part_areas', 'vayu_blocks_mega_menu_template_part_areas' );
143 // require_once VAYU_BLOCKS_DIR_PATH .'inc/patterns/single.php';