2020-01-25 07:52:35 +01:00
|
|
|
|
<?php
|
|
|
|
|
/*
|
2020-01-29 05:43:14 +01:00
|
|
|
|
Plugin Name: GitCafe Development Kit 极客公园开发套件
|
2020-01-29 20:58:39 +01:00
|
|
|
|
Plugin URI: https://gitcafe.net/
|
2020-01-29 05:43:14 +01:00
|
|
|
|
Description: 为WordPress主题开发提供底层支持
|
2021-10-06 15:44:41 +02:00
|
|
|
|
Version: 0.0.3
|
2020-01-29 20:58:39 +01:00
|
|
|
|
Author: 云落
|
|
|
|
|
Author URI: https://gitcafe.net/
|
2021-10-06 15:44:41 +02:00
|
|
|
|
Compatible:5.3.2
|
2020-03-15 14:29:06 +01:00
|
|
|
|
*/
|
2020-01-29 05:43:14 +01:00
|
|
|
|
|
2020-02-03 19:12:24 +01:00
|
|
|
|
//万能的开头
|
2020-03-15 14:29:06 +01:00
|
|
|
|
if (!defined('ABSPATH')) {exit;}
|
2020-01-25 07:52:35 +01:00
|
|
|
|
|
2020-02-03 19:12:24 +01:00
|
|
|
|
//版本和兼容检查
|
2020-03-15 14:29:06 +01:00
|
|
|
|
function deactivate_myself()
|
|
|
|
|
{
|
|
|
|
|
deactivate_plugins(plugin_basename(__FILE__));
|
2021-10-06 15:44:41 +02:00
|
|
|
|
wp_die('启动失败,GDK插件不兼容Git主题且需要运行在 PHP 7.2 版本及更高的环境下。');
|
2020-01-25 07:52:35 +01:00
|
|
|
|
}
|
2020-02-03 19:12:24 +01:00
|
|
|
|
|
|
|
|
|
if (defined('GIT_URL')) {
|
2020-03-15 14:29:06 +01:00
|
|
|
|
add_action('update_option_active_plugins', 'deactivate_myself');
|
2020-02-03 19:12:24 +01:00
|
|
|
|
}
|
|
|
|
|
|
2021-10-06 15:44:41 +02:00
|
|
|
|
if (!version_compare(PHP_VERSION, '7.2', '>=')) {
|
2020-03-15 14:29:06 +01:00
|
|
|
|
add_action('update_option_active_plugins', 'deactivate_myself');
|
2020-01-25 07:52:35 +01:00
|
|
|
|
}
|
|
|
|
|
|
2020-01-29 05:43:14 +01:00
|
|
|
|
//定义各种常量
|
2021-10-06 15:44:41 +02:00
|
|
|
|
define('GDK_PLUGIN_VER', '0.0.3');
|
2020-03-15 14:29:06 +01:00
|
|
|
|
define('GDK_PLUGIN_FILE', __FILE__); //插件入口文件
|
|
|
|
|
define('GDK_BASE_URL', plugin_dir_url(__FILE__)); //插件目录url
|
|
|
|
|
define('GDK_ROOT_PATH', plugin_dir_path(__FILE__)); //插件目录路径
|
2020-01-25 18:54:41 +01:00
|
|
|
|
|
2020-01-29 05:43:14 +01:00
|
|
|
|
//加载各种资源
|
2020-03-15 14:29:06 +01:00
|
|
|
|
include 'framework/frame_load.php'; //加载后台框架
|
|
|
|
|
include 'class/class_load.php'; //加载各种类
|
|
|
|
|
include 'functions/func_load.php'; //加载函数
|
2021-10-06 15:44:41 +02:00
|
|
|
|
include 'assets/assets_load.php'; //加载静态资源
|
|
|
|
|
|
|
|
|
|
|