定制 afragen/add-plugin-dependency-api 二次开发

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

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

afragen/add-plugin-dependency-api

最新稳定版本:0.4.8

Composer 安装命令:

composer require afragen/add-plugin-dependency-api

包简介

Library that helps WordPress plugin dependency management.

README 文档

README

Composer library for adding a plugin dependency response based upon use with Git Updater v12 or greater.

Description

This is an example to developers of non dot-org plugins that wish to take advantage of the Plugin Dependencies feature from the Requires Plugins header.

You can use composer to install this package within your WordPress plugin / theme.

Please ensure you are using the latest version of this framework in your composer.json

  1. Within your plugin or theme root folder, run the following command:
composer require afragen/add-plugin-dependency-api
  1. Add a filter to your plugin that requires a dependency that returns an array or JSON response containing a REST endpoint that returns a valid plugins_api() response.

A query arg of the plugin slug, ?slug=my-plugin-dependency, will be passed to the endpoint returned from the filter. The slug originates from the Require Plugins header.

// Add the sites with REST enpoints that return plugins_api() data when passed `slug` query arg.
// You can also return URL to a JSON file containing the appropriate data.
add_filter(
	'plugin_dependency_endpoints',
	function () {
		return [ 'https://git-updater.com/wp-json/git-updater/v1/plugins-api/' ];
	}
);

To see an example REST endpoint return view https://git-updater.com/wp-json/git-updater/v1/plugins-api/?slug=git-updater in the browser.

Development

PRs are welcome against the develop branch.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-09-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固