-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhogan-core.php
70 lines (61 loc) · 1.98 KB
/
hogan-core.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
/**
* Plugin Name: Hogan
* Plugin URI: https://github.com/DekodeInteraktiv/hogan-core
* GitHub Plugin URI: https://github.com/DekodeInteraktiv/hogan-core
* Description: Modular Flexible Content System for ACF Pro
* Version: 1.4.3
* Author: Dekode
* Author URI: https://dekode.no
* License: GPL-3.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
* Text Domain: hogan-core
* Domain Path: /languages/
*
* @package Hogan
* @author Dekode
*/
declare( strict_types = 1 );
namespace Dekode\Hogan;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
define( 'HOGAN_CORE_VERSION', '1.4.3' );
define( 'HOGAN_CORE_PATH', plugin_dir_path( __FILE__ ) );
define( 'HOGAN_CORE_DIR', dirname( plugin_basename( __FILE__ ) ) );
define( 'HOGAN_CORE_URL', plugin_dir_url( __FILE__ ) );
define( 'HOGAN_CORE_PHP_REQUIRED_VERSION', '7' );
/*
* Check the PHP version, if it's not a supported version, return without running
* any more code as the user will not be able to use Hogan.
*/
if ( version_compare( phpversion(), HOGAN_CORE_PHP_REQUIRED_VERSION, '<' ) ) {
add_action( 'admin_notices', function() {
$screen = get_current_screen();
// Only display message on the plugin screen.
if ( 'plugins' !== $screen->id ) {
return;
}
?>
<div class="notice notice-error">
<?php
printf( '<p><strong>%s</strong> — %s</p>',
esc_html__( 'Hogan Disabled', 'hogan-core' ),
esc_html__( 'You are running an unsupported version of PHP.', 'hogan-core' )
);
/* translators: %s: required PHP version */
printf( '<p>' . esc_html__( 'Hogan requires PHP Version %s, please upgrade to use Hogan.', 'hogan-core' ) . '</p>',
esc_html( HOGAN_CORE_PHP_REQUIRED_VERSION )
);
?>
</div>
<?php
} );
// Bail out now so no additional code is run.
return;
}
require_once 'includes/class-module.php';
require_once 'includes/class-core.php';
require_once 'includes/helper-functions.php';
require_once 'includes/hogan-deprecated.php';
Core::get_instance();