官网: https://wppb.me/
Github: https://github.com/DevinVinson/WordPress-Plugin-Boilerplate
Folder | Subfolder / File | Description |
1. root | algo-trade.php | 加载插件 |
2. /includes | class-algo-trade.php | load_dependencies() 注册实体列表 |
class-algo-trade-activator.php | 重写activator (Optional) | |
class-algo-trade-deactivator.php | 重写deactivator (Optional) | |
class-algo-trade-i18n.php | load_plugin_textdomain() 加载.mo file | |
class-algo-trade-loader.php | 注册器 (可忽略) | |
3. /admin | /css | |
/js | ||
/partials | 不建议使用 | |
class-algo-trade-admin.php |
enqueue_styles() 加载css enqueue_scripts() 加载js |
|
4. /public | /css | |
/js | ||
/partials | ||
class-algo-trade-public.php | ||
4. /languages | .mo files |
优点:
/includes 核心组件职责分明。
分隔了/admin和/public。