[wp-trac] [WordPress Trac] #29890: Make menu descriptions available to be displayed on the front-end

WordPress Trac noreply at wordpress.org
Wed Oct 8 15:47:30 UTC 2014


#29890: Make menu descriptions available to be displayed on the front-end
-------------------------+-----------------------
 Reporter:  obenland     |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  4.1
Component:  Menus        |     Version:  3.0
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:  template
-------------------------+-----------------------

Comment (by DrewAPicture):

 Replying to [comment:8 cainm]:
 > Replying to [comment:7 DrewAPicture]:
 > > In [attachment:29890.4.diff] I went with 'item_descriptions' instead
 of 'show_description'. This is because the latter implies a single menu
 description whereas the former implies individual item descriptions.
 >
 > I think @obenland was following the precedent set with functions like
 `wp_list_pages`, where 'show_date' is used.

 Yep, I was just talking to him on Skype :)

 In [attachment:29890.5.diff] I went instead with 'show_descriptions'. That
 at least implies the intent.

 Argument naming can be hard. The general rule of thumb is to consider the
 purpose of the function you're adding arguments for. In this case, using
 the singular 'show_description' implies that you're showing a description
 for the entire menu. Using the plural 'show_descriptions' implies there
 are more than one of them, and from that we can indirectly infer that this
 argument applies to the multiple menu items within the menu this function
 generates.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29890#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list