-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathphotography-portfolio.php
131 lines (99 loc) · 3.34 KB
/
photography-portfolio.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?php
/**
* @package Easy Photography portfolio
* @link https://pyronaur.com
*
* @wordpress-plugin
* Plugin Name: Easy Photography Portfolio
* Plugin URI: http://pyronaur.com/plugins/photography-portfolio
* Description: Add a photography portfolio to any WordPress theme. Designed for Photographers, yet made with theme developers in mind.
* Version: 1.5.1
* Author: Pyronaur
* Author URI: https://pyronaur.com
* License: GPL-3.0+
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt
* Text Domain: photography-portfolio
* Domain Path: /languages
*/
// Disable Formatter to prevent autoformatting to PHP 5.4+ array format
// @formatter:off
/**
* This file should work without errors on PHP 5.2.17
* Use this instead of __DIR__
*/
$__DIR = dirname( __FILE__ );
/**
* Define Constants
*/
define( 'CLM_ABSPATH', $__DIR . '/' );
define( 'CLM_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
define( 'CLM_PLUGIN_DIR_URL', plugin_dir_url( __FILE__ ) );
define( 'CLM_THEME_PATH', 'photography-portfolio/' );
define( 'CLM_PLUGIN_THEME_PATH', CLM_ABSPATH . 'public/templates/' );
/**
* Require PHP 5.4
* Instantly auto-deactivate if plugin requirements are not met
*/
if ( version_compare( phpversion(), '5.4', '<' ) ) {
include( ABSPATH . "wp-includes/pluggable.php" );
require_once $__DIR . '/php-require-54.php';
$PP_Requre_PHP54 = new Photography_Portfolio_Require_PHP54();
function phort_auto_deactivate() {
deactivate_plugins( plugin_basename( __FILE__ ) );
}
if ( current_user_can( 'activate_plugins' ) ) {
add_action( 'admin_notices', array( &$PP_Requre_PHP54, 'admin_notice' ) );
add_action( 'admin_init', 'phort_auto_deactivate' );
}
}
// ============================================================================
// Initialize Photography Portfolio
// ============================================================================
else {
/**
* Setup Autoloading
*/
require_once $__DIR . '/vendor/autoload.php';
/**
* Include CMB2
*/
if ( file_exists( $__DIR . '/vendor/webdevstudios/cmb2/init.php' ) ) {
require_once $__DIR . '/vendor/webdevstudios/cmb2/init.php';
}
/**
* Require the Plugin God object.
*/
require_once $__DIR . '/Easy_Photography_Portfolio.php';
/**
* Template Tags, public functions usage in themes
*/
require_once $__DIR . '/public/functions/options.php';
require_once $__DIR . '/public/functions/functions.php';
require_once $__DIR . '/public/functions/slugs.php';
require_once $__DIR . '/public/functions/template-tags.php';
require_once $__DIR . '/public/functions/hooks.php';
/**
* Add CMB2 Symlinks support in development environments
*/
if ( defined( "WP_DEBUG" ) && WP_DEBUG ) {
require_once $__DIR . '/cmb-symlinks.php';
}
/**
* Flush permalinks after plugin is activated
*/
// phort_plugin_activation_hook lives here:
require_once $__DIR . '/activation-hooks.php';
// register_activation_hook is best called from this file
register_activation_hook( __FILE__, 'phort_plugin_activation_hook' );
/**
* 3rd party plugins & themes compatibility
*
* @since 1.1.2
*/
require_once $__DIR . '/compatibility/compatibility.php';
/**
* Boot Easy_Photography_Portfolio
* This happens before WordPress `init`
*/
add_action( 'after_setup_theme', 'phort_instance', 50 );
}