-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathgenesis-custom-blocks.php
71 lines (61 loc) · 1.76 KB
/
genesis-custom-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
<?php
/**
* Genesis Custom Blocks
*
* @package Genesis\CustomBlocks
* @copyright Copyright(c) 2022, Genesis Custom Blocks
* @license http://opensource.org/licenses/GPL-2.0 GNU General Public License, version 2 (GPL-2.0)
*
* Plugin Name: Genesis Custom Blocks
* Description: The easy way to build custom blocks for Gutenberg.
* Version: 1.7.1
* Author: Genesis Custom Blocks
* Author URI: https://studiopress.com
* License: GPL2
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: genesis-custom-blocks
* Domain Path: languages
*/
use Genesis\CustomBlocks\Plugin;
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
require_once __DIR__ . '/vendor/autoload.php';
/**
* Get the plugin object.
*
* @return Plugin
*/
function genesis_custom_blocks() {
static $instance;
if ( null === $instance ) {
$instance = new Plugin();
}
return $instance;
}
/**
* Set up the plugin instance.
*/
genesis_custom_blocks()
->set_basename( plugin_basename( __FILE__ ) )
->set_directory( plugin_dir_path( __FILE__ ) )
->set_file( __FILE__ )
->set_slug( 'genesis-custom-blocks' )
->set_url( plugin_dir_url( __FILE__ ) )
->set_version( __FILE__ )
->init();
add_action( 'plugins_loaded', [ genesis_custom_blocks(), 'plugin_loaded' ] );
add_action( 'plugins_loaded', [ genesis_custom_blocks(), 'require_deprecated' ], 11 );
/**
* Initialize checking of plugin updates from WP Engine.
*/
function genesis_custom_blocks_check_for_upgrades() {
$properties = [
'plugin_slug' => 'genesis-custom-blocks',
'plugin_basename' => plugin_basename( __FILE__ ),
];
require_once __DIR__ . '/php/PluginUpdater.php';
new \Genesis\CustomBlocks\PluginUpdater( $properties );
}
add_action( 'admin_init', 'genesis_custom_blocks_check_for_upgrades' );