钩子文档

show_advanced_plugins

💡 云策文档标注

概述

show_advanced_plugins 是一个 WordPress 过滤器,用于控制是否显示高级插件列表表,包括 must-use 和 drop-ins 两种类型。

关键要点

  • 过滤器名称:show_advanced_plugins
  • 参数:$show(布尔值,默认 true)控制是否显示;$type(字符串,接受 'mustuse' 或 'dropins')指定插件类型
  • 应用场景:在单站点或多站点网络中,用于过滤 must-use 或 drop-ins 插件的显示
  • 相关函数:WP_Plugins_List_Table::prepare_items() 使用此过滤器
  • 版本历史:自 WordPress 3.0.0 引入

📄 原文内容

Filters whether to display the advanced plugins list table.

Description

There are two types of advanced plugins – must-use and drop-ins – which can be used in a single site or Multisite network.

The $type parameter allows you to differentiate between the type of advanced plugins to filter the display of. Contexts include ‘mustuse’ and ‘dropins’.

Parameters

$showbool
Whether to show the advanced plugins for the specified plugin type. Default true.
$typestring
The plugin type. Accepts 'mustuse', 'dropins'.

Source

if ( apply_filters( 'show_advanced_plugins', true, 'mustuse' ) ) {

Changelog

Version Description
3.0.0 Introduced.