钩子文档

show_network_active_plugins

💡 云策文档标注

概述

show_network_active_plugins 是一个 WordPress 过滤器,用于控制是否在插件管理界面显示网络激活的插件。它影响网络激活插件和仅网络插件的显示,但不允许在此界面进行网络激活或停用操作。

关键要点

  • 过滤器名称:show_network_active_plugins
  • 功能:控制是否显示网络激活插件和仅网络插件(插件头中带有“Network: true”)
  • 参数:$show(布尔值),默认值取决于当前用户是否为超级管理员(Super Admin)
  • 使用场景:在 WP_Plugins_List_Table::prepare_items() 方法中应用
  • 版本:自 WordPress 4.4.0 引入

代码示例

$show_network_active = apply_filters( 'show_network_active_plugins', $show );

📄 原文内容

Filters whether to display network-active plugins alongside plugins active for the current site.

Description

This also controls the display of inactive network-only plugins (plugins with “Network: true” in the plugin header).

Plugins cannot be network-activated or network-deactivated from this screen.

Parameters

$showbool
Whether to show network-active plugins. Default is whether the current user can manage network plugins (ie. a Super Admin).

Source

$show_network_active = apply_filters( 'show_network_active_plugins', $show );

Changelog

Version Description
4.4.0 Introduced.