[wp-trac] [WordPress Trac] #23119: UX Improvements to nav-menus.php

WordPress Trac noreply at wordpress.org
Mon Feb 11 20:33:19 UTC 2013


#23119: UX Improvements to nav-menus.php
-----------------------------------------------+------------------
 Reporter:  lessbloat                          |       Owner:
     Type:  enhancement                        |      Status:  new
 Priority:  normal                             |   Milestone:  3.6
Component:  Menus                              |     Version:
 Severity:  normal                             |  Resolution:
 Keywords:  has-patch needs-testing 3.6-menus  |
-----------------------------------------------+------------------

Comment (by jkudish):

 Code reviewed, and latest changes posted in
 [http://core.trac.wordpress.org/raw-attachment/ticket/23119/23119.30.diff
 23119.30.diff]. Here are my notes:

 * added missing `absint()` when saving menu items
 * made some minor code standards/spacing adjustments (both in php and in
 js)
 * adjusted the way we count the number of existing pages to use
 `wp_count_posts()` instead of `get_pages()` for performance reasons
 * using `absint()` when getting the recently edited menu instead of just
 `(int)`, just to be safe
 * using `empty()` instead of just `!` when checking if there is a recently
 edited menu, just to be safe
 * using `empty()` instead of comparing against `0` when checking if there
 is a currently selected menu
 * making use of `selected()` in the new menu selection dropdown instead of
 doing an `if` dance and manually echoing `selected=selected`
 * replaced a URL that we were manually building with `?` to use
 `add_query_arg()` instead
 * addressed @ocean90's comment about the tax label name
 * removed some unneeded `remove_query_arg()`
 * fixed incorrect usage of `esc_attr_e()`
 * added missing escaping on one of the submit buttons
 * js: cached `$(this)` in a few spots that we missed it
 * js: yoda conditions
 * Note: I did not review the css
 * Note: Between `wp-admin/nav-menus.php` and `wp-admin/includes/nav-
 menu.php` we have a lot of code. We should probably take a closer look to
 see if there's any repetition, unused code and such to see if we can
 optimize a bit. This seemed like beyond the scope of this initial code
 review, so I didn't dig too deep for now.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23119#comment:203>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list