承接 rarst/update-blocker 相关项目开发

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

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

rarst/update-blocker

最新稳定版本:1.1

Composer 安装命令:

composer require rarst/update-blocker

包简介

Lightweight generic blocker of updates from official WordPress repositories

关键字:

README 文档

README

Update Blocker is a lightweight generic blocker of plugin, theme, and core updates from official WordPress repositories.

It was created as shared reusable plugin for the sake of no longer reinventing that particular wheel.

Goals

  • single main file
  • mu-plugins–friendly
  • no hard dependencies

Not goals

  • interface
  • elaborate API
  • as–library use
  • unreasonable compat

Installation

Plugin

  1. Download ZIP.
  2. Unpack files from inside into wp-content/plugins/update-blocker.

MU-plugin

  1. Download update-blocker.php.
  2. Place into wp-content/mu-plugins.
  3. Edit settings for blocks in the file.

Composer

Create project in the wp-content/plugins:

composer create-project rarst/update-blocker:~1.0

Or require in composer.json of site project:

{
	"require": {
		"rarst/update-blocker": "~1.0"
	}
}

Requiring on plugin/theme level is not implemented, use suggest:

{
	"suggest": {
		"rarst/update-blocker": "Prevents invalid updates from official repositories"
	}
}

Configuration

Plugin's settings have following structure:

array(
	'all'     => false,
	'files'   => array( '.git', '.svn', '.hg' ),
	'plugins' => array( 'update-blocker/update-blocker.php' ),
	'themes'  => array(),
	'core'    => false,
)
  • all — boolean, disables updates completely
  • files — array of plugin/theme root–relative files to detect for block
  • plugins — array of plugin base names (folder-name/plugin-name.php) to block
  • themes — array of theme slugs (theme-name) to block
  • core — boolean, disables core updates

Settings pass through update_blocker_blocked filter.

Processed data passes through update_blocker_plugins and update_blocker_themes filters during update checks.

Plugin opt–in

add_filter( 'update_blocker_blocked', function( $blocked ) {
	$blocked['plugins'][] = plugin_basename( __FILE__ ); // or just folder-name/plugin-name.php string
	return $blocked;
} );

Theme opt–in

add_filter( 'update_blocker_blocked', function( $blocked ) {
	$blocked['themes'][] = 'theme-name';
	return $blocked;
} );

Core opt–in

add_filter( 'update_blocker_blocked', function ( $blocked ) {
	$blocked['core'] = true;
	return $blocked;
} );

License

  • MIT

统计信息

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

GitHub 信息

  • Stars: 55
  • Watchers: 8
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-06-25