Skip to content
Prev Previous commit
Next Next commit
Navigation: Add @return inline documentation
  • Loading branch information
noisysocks committed Aug 18, 2020
commit 38da717124d14baf03f714b1674e5d3c8ed07547
11 changes: 10 additions & 1 deletion lib/navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ function gutenberg_update_nav_menu_item_content( $menu_id, $menu_item_db_id, $ar
* @see https://core.trac.wordpress.org/ticket/50544
*
* @param object $menu_item The menu item object.
*
* @return object Updated menu item object.
*/
function gutenberg_setup_block_nav_menu_item( $menu_item ) {
if ( 'block' === $menu_item->type ) {
Expand Down Expand Up @@ -104,6 +106,8 @@ function gutenberg_setup_block_nav_menu_item( $menu_item ) {
* @param WP_Post $item Menu item data object.
* @param int $depth Depth of menu item. Used for padding.
* @param stdClass $args An object of wp_nav_menu() arguments.
*
* @return string The menu item's updated HTML output.
*/
function gutenberg_output_block_nav_menu_item( $item_output, $item, $depth, $args ) {
if ( 'block' === $item->type ) {
Expand Down Expand Up @@ -131,6 +135,8 @@ function gutenberg_output_block_nav_menu_item( $item_output, $item, $depth, $arg
* @see https://core.trac.wordpress.org/ticket/50544
*
* @param array $menu_items The menu items, sorted by each menu item's menu order.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I notice some of the functions are missing @return documentation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*
* @return array Updated menu items, sorted by each menu item's menu order.
*/
function gutenberg_remove_block_nav_menu_items( $menu_items ) {
if ( current_theme_supports( 'block-nav-menus' ) ) {
Expand All @@ -155,7 +161,8 @@ function( $menu_item ) {
*
* @param array $menu_items The menu items to convert, sorted by each menu item's menu order.
* @param array $menu_items_by_parent_id All menu items, indexed by their parent's ID.
* @return array

* @return array Updated menu items, sorted by each menu item's menu order.
*/
function gutenberg_convert_menu_items_to_blocks(
$menu_items,
Expand Down Expand Up @@ -222,6 +229,8 @@ function gutenberg_convert_menu_items_to_blocks(
*
* @param string|null $output Nav menu output to short-circuit with. Default null.
* @param stdClass $args An object containing wp_nav_menu() arguments.
*
* @return string|null Nav menu output to short-circuit with.
*/
function gutenberg_output_block_nav_menu( $output, $args ) {
if ( ! current_theme_supports( 'block-nav-menus' ) ) {
Expand Down