函数文档

wp_paused_plugins()

💡 云策文档标注

概述

wp_paused_plugins() 函数用于获取存储暂停插件的 WP_Paused_Extensions_Storage 实例。该函数通过单例模式确保只有一个存储实例被创建,并指定存储类型为 'plugin'。

关键要点

  • 函数返回 WP_Paused_Extensions_Storage 实例,用于管理暂停的插件。
  • 使用静态变量实现单例模式,避免重复创建实例。
  • 存储类型被硬编码为 'plugin',专门处理插件暂停。

相关函数

  • WP_Paused_Extensions_Storage::__construct():构造函数,用于初始化存储。
  • WP_Recovery_Mode::store_error():存储错误以暂停相关扩展。
  • WP_Recovery_Mode::exit_recovery_mode():结束恢复模式会话。
  • wp_skip_paused_plugins():过滤插件列表,移除暂停的插件。
  • resume_plugin():尝试恢复单个插件。
  • deactivate_plugins():停用一个或多个插件。

📄 原文内容

Get the instance for storing paused plugins.

Return

WP_Paused_Extensions_Storage

Source

function wp_paused_plugins() {
	static $storage = null;

	if ( null === $storage ) {
		$storage = new WP_Paused_Extensions_Storage( 'plugin' );
	}

	return $storage;
}