定制 grit/plugin 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

grit/plugin

最新稳定版本:1.4.0

Composer 安装命令:

composer require grit/plugin

包简介

"basic plugin class for wordpress to build upon"

README 文档

README

This composer installable library adds basic boilerplate for WordPress plugins.

Installation

From within your plugin composer require the library

composer require grit/plugin

Usage

Extend the library with your own class. Use the Grit\Container class as injection container. Your main plugin file could look like this

//File: example-plugin.php
/**
 * Plugin Name:     Example plugin
 * Plugin URI:      PLUGIN SITE HERE
 * Description:     example
 * Author:          AUTHOR HERE
 * Author URI:      YOUR SITE HERE
 * Text Domain:     example
 * Domain Path:     /languages
 * Version:         0.1.0
 *
 * @package         Example
 */

require_once("vendor/autoload.php");

$container = Grit\Container::getInstance();

$container['example'] = new MyNamespace\Example(__FILE__);

The main class would look like this

//File: src/Example.php

namespace MyNamespace;

use Grit\Plugin;

class Example extends Plugin
{
    // your overrides and own functions here
}

Reference

Please refer to the docs folder.

统计信息

  • 总下载量: 43
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2022-12-09