From fee2d3ed941a588b2dadc8e939a68d2269905977 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 29 Sep 2021 13:39:59 +0000 Subject: [PATCH] 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 --- wp-includes/class-wp-admin-bar.php | 39 +++++++++++++++++++++++++++--- wp-includes/version.php | 2 +- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/wp-includes/class-wp-admin-bar.php b/wp-includes/class-wp-admin-bar.php index 7d3470f538..2d8814e590 100644 --- a/wp-includes/class-wp-admin-bar.php +++ b/wp-includes/class-wp-admin-bar.php @@ -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. diff --git a/wp-includes/version.php b/wp-includes/version.php index 9fb0c4e4b5..58426470f6 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.