钩子文档

_network_admin_menu

💡 云策文档标注

概述

_network_admin_menu 是一个 WordPress 动作钩子,在网络管理面板的菜单加载前触发,允许开发者在菜单结构完成前进行修改。

关键要点

  • 触发时机:在网络管理面板的菜单加载前,基于用户权限移除菜单项之前。
  • 主要用途:可用于修改网络管理面板的菜单,但更常见的是使用 network_admin_menu 钩子在菜单完成后进行修改。
  • 技术细节:通过 do_action( '_network_admin_menu' ) 调用,自 WordPress 3.1.0 版本引入。

📄 原文内容

Fires before the administration menu loads in the Network Admin.

Description

The hook fires before menus and sub-menus are removed based on user privileges.

More Information

This action could be used to modify the menu in the network admin panel. It runs before the basic network admin panel menu structure is complete. It is more usual to use the network_admin_menu action to modify the menu after it is complete.

Source

do_action( '_network_admin_menu' );

Changelog

Version Description
3.1.0 Introduced.