Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#27367 closed defect (bug) (fixed)

Hook Docs: wp-includes/nav-menu.php

Reported by: dustyf's profile dustyf Owned by: drewapicture's profile DrewAPicture
Milestone: 3.9 Priority: normal
Severity: normal Version:
Component: Menus Keywords: has-patch commit
Focuses: docs Cc:

Description

Attached patch has docs for the following filters and actions in wp-includes/nav-menu.php:

FILTERS
wp_get_nav_menus
wp_get_nav_menu_items
nav_menu_attr_title
nav_menu_description
wp_setup_nav_menu_item

ACTIONS
wp_delete_nav_menu
wp_create_nav_menu
wp_update_nav_menu
wp_update_nav_menu_item

Attachments (5)

wp-includes-nav-menu.php.diff (4.8 KB) - added by dustyf 11 years ago.
Patch file for wp-includes/nav-menu.php
wp-includes-nav-menu.php-2.diff (4.8 KB) - added by dustyf 11 years ago.
Inline docs for wp-includes/nav-menu.php take two
wp-includes-nav-menu.php-3.diff (4.8 KB) - added by dustyf 11 years ago.
Docs for wp-includes/nav-menu.php take 3
27367.4.diff (4.6 KB) - added by kpdesign 11 years ago.
Fourth pass
27367.diff (5.1 KB) - added by DrewAPicture 11 years ago.
Final pass.

Download all attachments as: .zip

Change History (13)

@dustyf
11 years ago

Patch file for wp-includes/nav-menu.php

#1 @DrewAPicture
11 years ago

  • Keywords has-patch added
  • Owner set to DrewAPicture
  • Status changed from new to reviewing

Nice, thanks for the patch Dusty. We'll try to get you a review soon.

#2 @DrewAPicture
11 years ago

  • Keywords needs-patch added; has-patch removed

Thanks for the patch. Here are some notes on wp-includes-nav-menu.php.diff:

wp_delete_nav_menu hook:

  • Should use a docs-specific variable for the term id, perhaps $term_id

wp_create_nav_menu hook:

  • Again, use a docs-specific variable for the first parameter. You could even use $term_id again.
  • General rule of thumb in core inline docs is to use 'ID', instead 'id' (in most cases).

wp_update_nav_menu hook:

  • s/id/ID

wp_update_nav_menu_item hook:

  • Add a standalone @see wp_update_nav_menu_items() between the @since and @param lines (this is actually a reference for the third parameter, $args, inherited from the parent function.

wp_get_nav_menus filter:

  • Add an empty line above the docblock
  • Maybe add a standalone @see get_terms() line between the @since and @param lines

nav_menu_attr_title filter:

  • Use a docs-specific variable for the parameter, maybe $title or $item_title or something

@dustyf
11 years ago

Inline docs for wp-includes/nav-menu.php take two

#3 @dustyf
11 years ago

Thanks for the suggestions Drew. I've attached a file with the suggested changes.

#4 @DrewAPicture
11 years ago

  • Keywords has-patch added; needs-patch removed

Great, I'll take a look.

@dustyf
11 years ago

Docs for wp-includes/nav-menu.php take 3

#5 @dustyf
11 years ago

Fixed a bit of code I forgot to take out before diffing. Use the last one instead.

@kpdesign
11 years ago

Fourth pass

#6 @kpdesign
11 years ago

27367.4.diff contains changes for language consistency and formatting.

@DrewAPicture
11 years ago

Final pass.

#7 @DrewAPicture
11 years ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 3.9

27367.diff should do it.

#8 @DrewAPicture
11 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 27700:

Inline documentation for hooks in wp-includes/nav-menu.php.

Props dustyf, kpdesign.
Fixes #27367.

Note: See TracTickets for help on using tickets.