mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 09:07:59 +01:00
Docs: Improve documentation for WP_Admin_Bar
methods.
Add some missing descriptions and `@since` tags. Follow-up to [15671], [19120], [19429], [19501], [19558], [25475], [25478], [25563], [32534], [35157], [40947], [45821], [48826]. Props yagniksangani, hellofromTonya, audrasjb, sabernhardt, mukesh27, rehanali, SergeyBiryukov. Fixes #54191. Built from https://develop.svn.wordpress.org/trunk@51876 git-svn-id: http://core.svn.wordpress.org/trunk@51469 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
06cea7de84
commit
fee2d3ed94
@ -18,6 +18,8 @@ class WP_Admin_Bar {
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* @since 3.3.0
|
||||
*
|
||||
* @param string $name
|
||||
* @return string|array|void
|
||||
*/
|
||||
@ -33,6 +35,9 @@ class WP_Admin_Bar {
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the admin bar.
|
||||
*
|
||||
* @since 3.1.0
|
||||
*/
|
||||
public function initialize() {
|
||||
$this->user = new stdClass;
|
||||
@ -82,7 +87,7 @@ class WP_Admin_Bar {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a node (menu item) to the Admin Bar menu.
|
||||
* Adds a node (menu item) to the admin bar menu.
|
||||
*
|
||||
* @since 3.3.0
|
||||
*
|
||||
@ -93,7 +98,7 @@ class WP_Admin_Bar {
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a node from the admin bar.
|
||||
* Removes a node from the admin bar.
|
||||
*
|
||||
* @since 3.1.0
|
||||
*
|
||||
@ -179,6 +184,8 @@ class WP_Admin_Bar {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 3.3.0
|
||||
*
|
||||
* @param array $args
|
||||
*/
|
||||
final protected function _set_node( $args ) {
|
||||
@ -188,6 +195,8 @@ class WP_Admin_Bar {
|
||||
/**
|
||||
* Gets a node.
|
||||
*
|
||||
* @since 3.3.0
|
||||
*
|
||||
* @param string $id
|
||||
* @return object|void Node.
|
||||
*/
|
||||
@ -199,6 +208,8 @@ class WP_Admin_Bar {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 3.3.0
|
||||
*
|
||||
* @param string $id
|
||||
* @return object|void
|
||||
*/
|
||||
@ -217,6 +228,8 @@ class WP_Admin_Bar {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 3.3.0
|
||||
*
|
||||
* @return array|void
|
||||
*/
|
||||
final public function get_nodes() {
|
||||
@ -232,6 +245,8 @@ class WP_Admin_Bar {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 3.3.0
|
||||
*
|
||||
* @return array|void
|
||||
*/
|
||||
final protected function _get_nodes() {
|
||||
@ -243,7 +258,7 @@ class WP_Admin_Bar {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a group to a toolbar menu node.
|
||||
* Adds a group to a toolbar menu node.
|
||||
*
|
||||
* Groups can be used to organize toolbar items into distinct sections of a toolbar menu.
|
||||
*
|
||||
@ -267,6 +282,8 @@ class WP_Admin_Bar {
|
||||
/**
|
||||
* Remove a node.
|
||||
*
|
||||
* @since 3.1.0
|
||||
*
|
||||
* @param string $id The ID of the item.
|
||||
*/
|
||||
public function remove_node( $id ) {
|
||||
@ -274,6 +291,8 @@ class WP_Admin_Bar {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 3.3.0
|
||||
*
|
||||
* @param string $id
|
||||
*/
|
||||
final protected function _unset_node( $id ) {
|
||||
@ -281,6 +300,7 @@ class WP_Admin_Bar {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 3.1.0
|
||||
*/
|
||||
public function render() {
|
||||
$root = $this->_bind();
|
||||
@ -290,6 +310,8 @@ class WP_Admin_Bar {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 3.3.0
|
||||
*
|
||||
* @return object|void
|
||||
*/
|
||||
final protected function _bind() {
|
||||
@ -426,6 +448,8 @@ class WP_Admin_Bar {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 3.3.0
|
||||
*
|
||||
* @param object $root
|
||||
*/
|
||||
final protected function _render( $root ) {
|
||||
@ -457,6 +481,8 @@ class WP_Admin_Bar {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 3.3.0
|
||||
*
|
||||
* @param object $node
|
||||
*/
|
||||
final protected function _render_container( $node ) {
|
||||
@ -472,6 +498,8 @@ class WP_Admin_Bar {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 3.3.0
|
||||
*
|
||||
* @param object $node
|
||||
*/
|
||||
final protected function _render_group( $node ) {
|
||||
@ -497,6 +525,8 @@ class WP_Admin_Bar {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 3.3.0
|
||||
*
|
||||
* @param object $node
|
||||
*/
|
||||
final protected function _render_item( $node ) {
|
||||
@ -596,6 +626,9 @@ class WP_Admin_Bar {
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds menus to the admin bar.
|
||||
*
|
||||
* @since 3.1.0
|
||||
*/
|
||||
public function add_menus() {
|
||||
// User-related, aligned right.
|
||||
|
@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.9-alpha-51875';
|
||||
$wp_version = '5.9-alpha-51876';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user