-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathremote-data-blocks.php
More file actions
78 lines (62 loc) · 2.75 KB
/
remote-data-blocks.php
File metadata and controls
78 lines (62 loc) · 2.75 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
71
72
73
74
75
76
77
78
<?php declare(strict_types = 1);
/**
* Plugin Name: Remote Data Blocks
* Plugin URI: https://remotedatablocks.com
* Description: Integrate external data sources into WordPress blocks, enabling dynamic content from APIs and databases within the block editor and within your content.
* Author: Automattic
* Author URI: https://automattic.com
* Text Domain: remote-data-blocks
* Version: 1.5.0
* Requires at least: 6.7
* Requires PHP: 8.1
* License: GPLv2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/
namespace RemoteDataBlocks;
defined( 'ABSPATH' ) || exit();
// Check if the plugin is already loaded, if so, return early to prevent
// duplicate plugin instances. REMOTE_DATA_BLOCKS__LOADED was not introduced
// until v0.10.0.
if ( defined( 'REMOTE_DATA_BLOCKS__LOADED' ) || defined( 'REMOTE_DATA_BLOCKS__PLUGIN_VERSION' ) ) {
return;
}
define( 'REMOTE_DATA_BLOCKS__LOADED', true );
define( 'REMOTE_DATA_BLOCKS__PLUGIN_ROOT', __FILE__ );
define( 'REMOTE_DATA_BLOCKS__PLUGIN_DIRECTORY', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
define( 'REMOTE_DATA_BLOCKS__PLUGIN_VERSION', '1.5.0' );
define( 'REMOTE_DATA_BLOCKS__REST_NAMESPACE', 'remote-data-blocks/v1' );
// Autoloader
require_once __DIR__ . '/vendor/autoload.php';
// Other editor modifications
Editor\AdminNotices\AdminNotices::init();
Editor\DataBinding\BlockBindings::init();
Editor\DataBinding\InlineBindings::init();
Editor\DataBinding\Pagination::init();
Editor\BlockManagement\BlockRegistration::init();
Editor\BlockManagement\ConfigRegistry::init();
Editor\PatternEditor\PatternEditor::init();
// Telemetry
Telemetry\Telemetry::init( __FILE__ );
// Example API
ExampleApi\ExampleApi::init();
// Load Settings Page
PluginSettings\PluginSettings::init();
// Integrations
Integrations\Airtable\AirtableIntegration::init();
Integrations\Google\Sheets\GoogleSheetsIntegration::init();
Integrations\Shopify\ShopifyIntegration::init();
Integrations\VipBlockDataApi\VipBlockDataApi::init();
// REST endpoints
REST\RemoteDataController::init();
// QueryMonitor panel
Logging\QueryMonitor\QueryMonitor::init();
// Fire action to indicate that the plugin is loaded
do_action( 'remote_data_blocks_loaded' );
// Plugin developers: If you need to register additional code for testing, you
// can do so here, e.g.:
// require_once __DIR__ . '/example/blocks/art-block/art-block.php';
// require_once __DIR__ . '/example/blocks/book-block/book-block.php';
// require_once __DIR__ . '/example/blocks/github-markdown-block/github-markdown-block.php';
// require_once __DIR__ . '/example/blocks/shopify-mock-store-block/shopify-mock-store-block.php';
// require_once __DIR__ . '/example/blocks/weather-block/weather-block.php';
// require_once __DIR__ . '/example/blocks/zip-code-block/zip-code-block.php';