forked from wp-graphql/wp-graphql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
constants.php
38 lines (33 loc) · 1.12 KB
/
constants.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
<?php
/**
* Sets up constants for use throughout the plugin and by other extending plugins.
*
* This is in its own file so that it can be used via the autoloaded classes, but also
* can be pulled in when composer dependencies have not been installed.
*
* @return void
*/
function graphql_setup_constants() {
// Whether to autoload the files or not.
// This must be defined here and not within the WPGraphQL.php because this constant
// determines whether to autoload classes or not
if ( ! defined( 'WPGRAPHQL_AUTOLOAD' ) ) {
define( 'WPGRAPHQL_AUTOLOAD', true );
}
// Plugin version.
if ( ! defined( 'WPGRAPHQL_VERSION' ) ) {
define( 'WPGRAPHQL_VERSION', '1.16.0' );
}
// Plugin Folder Path.
if ( ! defined( 'WPGRAPHQL_PLUGIN_DIR' ) ) {
define( 'WPGRAPHQL_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
}
// Plugin Root File.
if ( ! defined( 'WPGRAPHQL_PLUGIN_FILE' ) ) {
define( 'WPGRAPHQL_PLUGIN_FILE', WPGRAPHQL_PLUGIN_DIR . '/wp-graphql.php' );
}
// The minimum version of PHP this plugin requires to work properly
if ( ! defined( 'GRAPHQL_MIN_PHP_VERSION' ) ) {
define( 'GRAPHQL_MIN_PHP_VERSION', '7.1' );
}
}