-
Notifications
You must be signed in to change notification settings - Fork 6
/
shiny-code.php
70 lines (61 loc) · 1.8 KB
/
shiny-code.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
<?php
/**
* Shiny Code
*
* @package ShinyCode
* @copyright Copyright (c) 2018, Cedaro, LLC
* @license GPL-2.0-or-later
*
* @wordpress-plugin
* Plugin Name: Shiny Code
* Plugin URI: https://github.com/cedaro/shiny-code
* Description: A Gutenberg block for editing and displaying code with syntax highlighting.
* Version: 1.0.1
* Author: Cedaro
* Author URI: https://www.cedaro.com/
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: shiny-code
* Domain Path: /languages
* Requires PHP: 7.0
* GitHub Plugin URI: cedaro/shiny-code
* Release Asset: true
*/
declare ( strict_types = 1 );
namespace Cedaro\WP\BlockType\Code;
use Cedaro\WP\Plugin\Provider\I18n;
// Exit if accessed directly.
if ( ! \defined( 'ABSPATH' ) ) {
exit;
}
/**
* Plugin version.
*
* @var string
*/
const VERSION = '1.0.1';
/**
* Load the Composer autoloader.
*/
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
require __DIR__ . '/vendor/autoload.php';
}
// Display a notice and bail if dependencies are missing.
if ( ! class_exists( __NAMESPACE__ . '\Plugin' ) ) {
require_once __DIR__ . '/php/functions.php';
add_action( 'admin_notices', __NAMESPACE__ . '\display_missing_dependencies_notice' );
return;
}
// Create the main plugin instance.
$shiny_code = ( new Plugin() )
->set_basename( plugin_basename( __FILE__ ) )
->set_directory( plugin_dir_path( __FILE__ ) )
->set_file( __DIR__ . '/shiny-code.php' )
->set_slug( 'shiny-code' )
->set_url( plugin_dir_url( __FILE__ ) );
// Register hook providers.
$shiny_code
->register_hooks( new I18n() )
->register_hooks( new BlockType\Code() )
->register_hooks( new Provider\PrismAssets() )
->register_hooks( new Provider\Settings() );