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:
Sergey Biryukov 2021-09-29 13:39:59 +00:00
parent 06cea7de84
commit fee2d3ed94
2 changed files with 37 additions and 4 deletions

View File

@ -18,6 +18,8 @@ class WP_Admin_Bar {
public $user; public $user;
/** /**
* @since 3.3.0
*
* @param string $name * @param string $name
* @return string|array|void * @return string|array|void
*/ */
@ -33,6 +35,9 @@ class WP_Admin_Bar {
} }
/** /**
* Initializes the admin bar.
*
* @since 3.1.0
*/ */
public function initialize() { public function initialize() {
$this->user = new stdClass; $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 * @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 * @since 3.1.0
* *
@ -179,6 +184,8 @@ class WP_Admin_Bar {
} }
/** /**
* @since 3.3.0
*
* @param array $args * @param array $args
*/ */
final protected function _set_node( $args ) { final protected function _set_node( $args ) {
@ -188,6 +195,8 @@ class WP_Admin_Bar {
/** /**
* Gets a node. * Gets a node.
* *
* @since 3.3.0
*
* @param string $id * @param string $id
* @return object|void Node. * @return object|void Node.
*/ */
@ -199,6 +208,8 @@ class WP_Admin_Bar {
} }
/** /**
* @since 3.3.0
*
* @param string $id * @param string $id
* @return object|void * @return object|void
*/ */
@ -217,6 +228,8 @@ class WP_Admin_Bar {
} }
/** /**
* @since 3.3.0
*
* @return array|void * @return array|void
*/ */
final public function get_nodes() { final public function get_nodes() {
@ -232,6 +245,8 @@ class WP_Admin_Bar {
} }
/** /**
* @since 3.3.0
*
* @return array|void * @return array|void
*/ */
final protected function _get_nodes() { 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. * 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. * Remove a node.
* *
* @since 3.1.0
*
* @param string $id The ID of the item. * @param string $id The ID of the item.
*/ */
public function remove_node( $id ) { public function remove_node( $id ) {
@ -274,6 +291,8 @@ class WP_Admin_Bar {
} }
/** /**
* @since 3.3.0
*
* @param string $id * @param string $id
*/ */
final protected function _unset_node( $id ) { final protected function _unset_node( $id ) {
@ -281,6 +300,7 @@ class WP_Admin_Bar {
} }
/** /**
* @since 3.1.0
*/ */
public function render() { public function render() {
$root = $this->_bind(); $root = $this->_bind();
@ -290,6 +310,8 @@ class WP_Admin_Bar {
} }
/** /**
* @since 3.3.0
*
* @return object|void * @return object|void
*/ */
final protected function _bind() { final protected function _bind() {
@ -426,6 +448,8 @@ class WP_Admin_Bar {
} }
/** /**
* @since 3.3.0
*
* @param object $root * @param object $root
*/ */
final protected function _render( $root ) { final protected function _render( $root ) {
@ -457,6 +481,8 @@ class WP_Admin_Bar {
} }
/** /**
* @since 3.3.0
*
* @param object $node * @param object $node
*/ */
final protected function _render_container( $node ) { final protected function _render_container( $node ) {
@ -472,6 +498,8 @@ class WP_Admin_Bar {
} }
/** /**
* @since 3.3.0
*
* @param object $node * @param object $node
*/ */
final protected function _render_group( $node ) { final protected function _render_group( $node ) {
@ -497,6 +525,8 @@ class WP_Admin_Bar {
} }
/** /**
* @since 3.3.0
*
* @param object $node * @param object $node
*/ */
final protected function _render_item( $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() { public function add_menus() {
// User-related, aligned right. // User-related, aligned right.

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @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. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.