-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtangible-blocks.php
More file actions
70 lines (54 loc) · 2.01 KB
/
tangible-blocks.php
File metadata and controls
70 lines (54 loc) · 2.01 KB
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
<?php
/**
* Plugin Name: Tangible Blocks
* Plugin URI: https://tangibleblocks.com/
* Description: Tangible Blocks is a system for universal blocks that work in Gutenberg, Elementor, Beaver Builder and beyond
* Version: 4.2.5
* GitHub URI: TangibleInc/blocks
* Author: Team Tangible
* Author URI: https://teamtangible.com
* License: GPLv2 or later
*/
use tangible\framework;
use tangible\updater;
define( 'TANGIBLE_BLOCKS_VERSION', '4.2.5' );
$module_path = is_dir(
($path = __DIR__ . '/../../tangible') // Module
) ? $path : __DIR__ . '/vendor/tangible'; // Plugin
require_once $module_path . '/framework/index.php';
require_once $module_path . '/template-system/index.php';
require_once $module_path . '/fields/index.php';
require_once $module_path . '/updater/index.php';
/**
* Get plugin instance
*/
function tangible_blocks($instance = false) {
static $plugin;
return $plugin ? $plugin : ($plugin = $instance);
}
add_action('plugins_loaded', function() {
// See https://github.com/TangibleInc/framework/#note-on-plugin-activation
if (defined('WP_SANDBOX_SCRAPING')) return;
$plugin = framework\register_plugin([
'name' => 'tangible-blocks',
'title' => 'Tangible Blocks',
'setting_prefix' => 'tangible_blocks',
'version' => TANGIBLE_BLOCKS_VERSION,
'file_path' => __FILE__,
'base_path' => plugin_basename( __FILE__ ),
'dir_path' => plugin_dir_path( __FILE__ ),
'url' => plugins_url( '/', __FILE__ ),
'assets_url' => plugins_url( '/assets', __FILE__ ),
]);
tangible_blocks( $plugin );
updater\register_plugin( $plugin );
// Features loaded will have in their local scope: $plugin
$template_system = tangible_template_system();
$loop = $template_system->loop;
$logic = $template_system->logic;
$html = $template_system->html;
$interface = $template_system->interface;
$ajax = $template_system->ajax;
$fields = tangible_fields();
require_once __DIR__.'/includes/index.php';
}, 10);