get_node()获取工具栏的自定义链接信息

目录

描述

This function returns a Toolbar object with all the properties of a single Toolbar item. Toolbar items are also called "nodes".

The Toolbar replaces the Admin Bar since WordPress Version 3.3.

note: This function is a method of the WP_Admin_Bar class and $wp_admin_bar global object, which may not exist except during the 'admin_bar_menu' or 'wp_before_admin_bar_render' hooks.

get_node() 描述

用法

<?php $wp_admin_bar->get_node$id ); ?>

get_node() 用法

参数

$id

(string) (必填) The node ID of the Toolbar item you want to get.

默认值: None

get_node() 参数

返回值

  • Object when the node is found.

get_node() 返回值

示例

Remove the Toolbar "Updates" Item if it Exists

Put this in your theme's functions.php file.

get_node() 示例

源文件

get_node() 函数的代码位于 wp-includes/class-wp-admin-bar.php.

get_node() 源文件

相关