承接 bernskioldmedia/wp-dependency-checker 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

bernskioldmedia/wp-dependency-checker

Composer 安装命令:

composer require bernskioldmedia/wp-dependency-checker

包简介

A modern way of checking for other plugin dependencies for your WordPress plugin.

关键字:

README 文档

README

This is a simple library for a WordPress plugin that check for plugin dependencies.

Often when we do private projects we may require one or more plugins to be active. It just isn't sensible for us to make everything work without. This saves time and money for us and our clients.a

When we do, we find ourselves in need of checking dependencies. This library helps you add it to your plugin in a modern PHP fashion using traits.

If dependencies are not found you can handle them and an admin notice is shown.

Getting started

All you need to do is include the Has_Dependencies trait in the plugin class where you want to check your dependencies. Ideally before you execute any code.

Then specificy a list of plugin dependencies in the $dependencies class variable.

use BernskioldMedia\WP\WP_Dependency_Checker\Traits\Has_Dependencies;

class My_Plugin {

    use Has_Dependencies;

    protected static $dependencies = [
        'My Dependency' => 'folder/main-file.php',
    ];

}

When you need to check for your dependencies, you then run an if:

if(self::has_dependencies()) {
    // Run my code
}

The has_dependencies function will automatically show an admin notice if falsy.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-04-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固