| 1 |
<?php |
| 2 |
/** |
| 3 |
* Sets up constants for use throughout the plugin and by other extending plugins. |
| 4 |
* |
| 5 |
* This is in its own file so that it can be used via the autoloaded classes, but also |
| 6 |
* can be pulled in when composer dependencies have not been installed. |
| 7 |
* |
| 8 |
* @return void |
| 9 |
*/ |
| 10 |
function graphql_setup_constants() { |
| 11 |
|
| 12 |
// Whether to autoload the files or not. |
| 13 |
// This must be defined here and not within the WPGraphQL.php because this constant |
| 14 |
// determines whether to autoload classes or not |
| 15 |
if ( ! defined( 'WPGRAPHQL_AUTOLOAD' ) ) { |
| 16 |
define( 'WPGRAPHQL_AUTOLOAD', true ); |
| 17 |
} |
| 18 |
|
| 19 |
// Plugin version. |
| 20 |
if ( ! defined( 'WPGRAPHQL_VERSION' ) ) { |
| 21 |
define( 'WPGRAPHQL_VERSION', '2.22.0' ); |
| 22 |
} |
| 23 |
|
| 24 |
// Plugin Folder Path. |
| 25 |
if ( ! defined( 'WPGRAPHQL_PLUGIN_DIR' ) ) { |
| 26 |
define( 'WPGRAPHQL_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); |
| 27 |
} |
| 28 |
|
| 29 |
// Plugin Root File. |
| 30 |
if ( ! defined( 'WPGRAPHQL_PLUGIN_FILE' ) ) { |
| 31 |
define( 'WPGRAPHQL_PLUGIN_FILE', WPGRAPHQL_PLUGIN_DIR . '/wp-graphql.php' ); |
| 32 |
} |
| 33 |
|
| 34 |
// The minimum version of PHP this plugin requires to work properly |
| 35 |
if ( ! defined( 'GRAPHQL_MIN_PHP_VERSION' ) ) { |
| 36 |
define( 'GRAPHQL_MIN_PHP_VERSION', '7.4' ); |
| 37 |
} |
| 38 |
} |
| 39 |
|