[wp-trac] [WordPress Trac] #29463: Add filter in WP_Nav_Menu_Widget

WordPress Trac noreply at wordpress.org
Tue Nov 4 17:43:29 UTC 2014


#29463: Add filter in WP_Nav_Menu_Widget
-------------------------------------------+-----------------------------
 Reporter:  cyman                          |       Owner:
     Type:  enhancement                    |      Status:  new
 Priority:  normal                         |   Milestone:  4.1
Component:  Widgets                        |     Version:  3.0
 Severity:  normal                         |  Resolution:
 Keywords:  dev-feedback has-patch commit  |     Focuses:  administration
-------------------------------------------+-----------------------------
Changes (by DrewAPicture):

 * keywords:  dev-feedback has-patch needs-docs => dev-feedback has-patch
     commit


Comment:

 Replying to [comment:14 cyman]:
 > While adding a context to the existing filter sounds like a great idea,
 I think that we should then also consider doing the same for the other
 native WP widgets in the `default-widgets.php` file - keeping the code
 consistent, right?

 You were correct the first time. I think adding a completely new filter
 here falls more in-line with core conventions for widgets.

 In [attachment:29463.diff] I've broken the args array out to a separate
 variable for readability, as well as passed the `$nav_menu` object and
 `$args` array containing display arguments for the current widget. Access
 to `$nav_menu` and `$args` should make targeting specific widgets, menus,
 and sidebars much simpler.

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


More information about the wp-trac mailing list