plantek/loader

此包最新版本(1.0.0)没有可用的许可信息。

WordPress插件开发Composer包,便于轻松集成此库以限制未获得有效许可证的插件用户。

1.0.0 2022-06-10 08:09 UTC

This package is not auto-updated.

Last update: 2024-09-28 20:20:11 UTC


README

🔌 Plantek Loader 🔌

<p>Composer Library for creating WordPress Plugin Loaders, Enables Plugin Updates, Licensing and Dependency Checking and may already be powering one of the plugins you use.</p>

💾 关于

WordPress插件加载器Composer库,支持插件更新,限制未获得有效许可证的用户使用插件,并检查依赖项。

🗒️ 使用方法

基本插件加载器

require_once 'vendor/autoload.php';

class ExampleLoader extends PlantekPluginLoader
{
    /**
     * Return the Plugin Name for PlantekPluginLoader to Handle
     *
     * @return string
     */
    public function pluginName()
    {
        return 'ExamplePlugin';
    }

    /**
     * Return a list of dependencies for the Plugin loader
     * For Example, Advanced Custom Fields
     *
     * @return array
     */
    public function getDependencies()
    {
        return [];
    }

    /**
     * Get Licenser Settings
     *
     * @return array
     */
    public function getLicenserOptions()
    {
        return [
            "enabled" => false,
        ];
    }

    /**
     * Get Updater Settings
     *
     * @return array
     */
    public function getUpdaterOptions()
    {
        return [
            'name' => 'ExamplePlugin',
            'repository' => 'https://gitlab.com/MarleyPlant/ExamplePlugin',
            'branch' => 'master',
            'pluginFile' => __FILE__
        ];
    }

    /**
     * Initialize the plugins core
     *
     * @return void
     */
    public function init()
    {
        include_once 'plugin.php';
    }
}

add_action('plugins_loaded', function () {
    $loader = new PlantekElementorLibraryLoader();
});

<br/>

💻 技术

HTML5 PHP


📎 许可证

版权所有 2023 Marley Plant

遵循Apache许可证2.0版本(“许可证”);除非遵守许可证规定,否则不得使用此文件。您可以在以下位置获得许可证副本:

https://apache.ac.cn/licenses/LICENSE-2.0

除非适用法律要求或书面同意,否则在许可证下分发的软件按“原样”基础分发,不提供任何明示或暗示的保证或条件。有关许可证的具体语言和限制,请参阅许可证。


📌 链接

Gitlab


📁 相关项目