Commit Graph

114 Commits

Author SHA1 Message Date
Drew Jaynes 39d7e0df8a Improve inline documentation for `Walker_Nav_Menu`, `Walker_Nav_Menu_Edit`, `Walker_Nav_Menu_Checklist`.
Includes previously undocumented parameters.

See #23406.

Built from https://develop.svn.wordpress.org/trunk@25643


git-svn-id: http://core.svn.wordpress.org/trunk@25560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-28 21:02:09 +00:00
Helen Hou-Sandí 5760809319 Add classes to menus to indicate that an item has sub-items: `.menu-item-has-children` for `wp_nav_menu()` and `.page_item_has_children` for `wp_page_menu()`. props hotchkissconsulting. fixes #23834.
Built from https://develop.svn.wordpress.org/trunk@25602


git-svn-id: http://core.svn.wordpress.org/trunk@25519 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-24 16:01:09 +00:00
Helen Hou-Sandí e9d72209f1 Inline docs for hooks in `wp-includes/nav-menu-template.php`. props Faison. see #25229.
Built from https://develop.svn.wordpress.org/trunk@25410


git-svn-id: http://core.svn.wordpress.org/trunk@25336 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-12 18:48:09 +00:00
Andrew Nacin a16ac64012 If a nav menu has no items, wait until after the wp_nav_menu_items filter before deciding whether to print nothing.
see [21868] for original commit. see #21576.
see #24035 for trunk.



git-svn-id: http://core.svn.wordpress.org/trunk@24634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-07-10 05:14:43 +00:00
Sergey Biryukov 6037f6f237 Add a filter for attributes on menu item links. props simonwheatley, DrewAPicture, SergeyBiryukov, nacin. fixes #16738.
git-svn-id: http://core.svn.wordpress.org/trunk@23565 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-01 17:06:35 +00:00
Ryan Boren 868873da55 Declare wp_rewrite as global in _wp_menu_item_classes_by_context().
Props andrewryno
fixes #7337


git-svn-id: http://core.svn.wordpress.org/trunk@23309 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-01-21 14:44:30 +00:00
Mark Jaquith a24c40fb00 Consistently use $wp_rewrite->index instead of hardcoding "index.php".
props wonderboymusic. fixes #7337

git-svn-id: http://core.svn.wordpress.org/trunk@23305 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-01-18 13:44:22 +00:00
Andrew Nacin f8becb79f7 Confirm that the nav menu's underlying object is in the proper taxonomy before adding the current-menu-item class. props SergeyBiryukov. fixes #21369.
git-svn-id: http://core.svn.wordpress.org/trunk@22302 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-10-25 20:32:01 +00:00
Andrew Nacin 6c56e0573c Prime post term caches for nav menu items. Avoid doing so in frontend template functions as it remains unneeded there. see #22189.
git-svn-id: http://core.svn.wordpress.org/trunk@22233 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-10-15 14:17:50 +00:00
Ryan Boren 77518e9c71 Objects no longer need to be explicitly passed by ref to call_user_func*() to be callable. Props wonderboymusic. fixes #21865
git-svn-id: http://core.svn.wordpress.org/trunk@22118 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-10-04 20:00:16 +00:00
Andrew Nacin a269ba85f7 If a nav menu has no menu items, print nothing (instead of empty container markup). props obenland. fixes #21576.
git-svn-id: http://core.svn.wordpress.org/trunk@21868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-16 17:07:56 +00:00
Ryan Boren c55cf716da Use set_url_scheme(). Props johnbillion, MarcusPope. see #19037 #20759
git-svn-id: http://core.svn.wordpress.org/trunk@21664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-30 13:33:00 +00:00
Ryan Boren 9377523bce Introduce WP_Post class. Clean up ancestors handling. Props scribu, toppa. fixes #10381 see #21309
git-svn-id: http://core.svn.wordpress.org/trunk@21559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-20 19:47:52 +00:00
nacin 62c65ba3ef Remove unused global reference. props ampt. fixes #20863.
git-svn-id: http://core.svn.wordpress.org/trunk@21252 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-09 19:48:04 +00:00
nacin 646ae32016 Only output the class attribute in wp_nav_menu() if we have classes to add. Don't waste time on an strlen() call. props niallkennedy, fixes #20483.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20513 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-18 19:06:22 +00:00
ryan fd1393ab7a Clear strict notices for the walkers. fixes #19249
git-svn-id: http://svn.automattic.com/wordpress/trunk@19679 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-04 23:03:46 +00:00
nacin cf981b4f25 Properly handle a blank nav menu custom URL when determining what page we're on. see #19699 for trunk.
git-svn-id: http://svn.automattic.com/wordpress/trunk@19657 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-03 18:15:16 +00:00
ryan 07ff8b216b Use one space, not two, after trailing punctuation. fixes #19537
git-svn-id: http://svn.automattic.com/wordpress/trunk@19593 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-12-13 23:45:31 +00:00
nacin 12bc347475 Detect current menu items for root-relative URLs. props filosofo, fixes #15954.
git-svn-id: http://svn.automattic.com/wordpress/trunk@18746 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-09-22 02:25:57 +00:00
ryan 85f1feed84 Bring out the shears.
git-svn-id: http://svn.automattic.com/wordpress/trunk@17228 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-01-06 04:11:14 +00:00
ryan 09f625b796 Don't assume queried object is a term. Fixes non-existent var notice. Props filosofo. fixes #15944
git-svn-id: http://svn.automattic.com/wordpress/trunk@17109 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-22 17:40:51 +00:00
nacin caf0ec965e Pass args to nav_menu_css_class filter. props scribu, fixes #15808.
git-svn-id: http://svn.automattic.com/wordpress/trunk@16912 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-14 13:25:07 +00:00
markjaquith 0c10eec60c Highlight home page Custom Nav Menu item even when extra query args are present in the URL (only if all other highlights fail). props filosofo. fixes #13994
git-svn-id: http://svn.automattic.com/wordpress/trunk@16742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-06 03:54:57 +00:00
nacin 42394406c1 Check that ancestors are not the currently queried objects in nav menu classes. props filosofo, fixes #14518.
git-svn-id: http://svn.automattic.com/wordpress/trunk@16731 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-05 04:29:56 +00:00
nacin 4d6e524d90 Escape the wrap ID and class attributes going into sprintf() and s/slug/wrap_id/ to make it more obvious. see #14235.
git-svn-id: http://svn.automattic.com/wordpress/trunk@16520 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-11-21 13:37:09 +00:00
nacin 17a87ff30f Introduce items_wrap arg to wp_nav_menu(). props filosofo, fixes #14235.
git-svn-id: http://svn.automattic.com/wordpress/trunk@16519 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-11-21 13:32:02 +00:00
nacin 0fceac8180 Add menu-item-object-$object class. props filosofo, fixes #14053.
git-svn-id: http://svn.automattic.com/wordpress/trunk@16095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-10-29 22:49:42 +00:00
nacin 14ccdbec33 Pruning shears.
git-svn-id: http://svn.automattic.com/wordpress/trunk@15904 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-10-21 19:55:28 +00:00
nacin 5e1184aa57 Pinking shears.
git-svn-id: http://svn.automattic.com/wordpress/trunk@15843 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-10-19 07:48:22 +00:00
scribu 59a7f7f015 Remove redundant call to function_exists() in wp_nav_menu(). Fixes #15094
git-svn-id: http://svn.automattic.com/wordpress/trunk@15774 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-10-11 13:21:08 +00:00
nacin 57ccc147e2 Make it explicit that you can set fallback_cb to false in wp_nav_menu.
git-svn-id: http://svn.automattic.com/wordpress/trunk@15772 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-10-11 03:16:45 +00:00
markjaquith e7c4ac4014 When doing current page highlighting logic, apply untrailingslashit() to everything so that slash additions or omissions still match. fixes #14208. props filosofo
git-svn-id: http://svn.automattic.com/wordpress/trunk@15584 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-09-07 04:17:37 +00:00
ryan 725f073450 Fix typo in [15544]
git-svn-id: http://svn.automattic.com/wordpress/trunk@15545 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-08-27 16:53:26 +00:00
nbachiyski d7fcadc5b8 Make menus manipulation easier for plugin developers
* Add a wp_nav_menu_objects filter, which gets a sorted list of all menu node objects in the currently rendered menu
 * Add current, current_item_ancestor and current_item_parent boolean member variables to each menu node object, which are true when the item has the current-menu-item, current-menu-ancestor or current-menu-parent CSS class respectively


git-svn-id: http://svn.automattic.com/wordpress/trunk@15544 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-08-27 16:13:39 +00:00
nacin 38ce17e03b Prevent the same menu item from receiving duplicate IDs if the menu is used twice. All menu items now get a class with their post ID; only the first item now gets an ID. fixes #13976 for trunk.
git-svn-id: http://svn.automattic.com/wordpress/trunk@15407 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-07-13 21:30:59 +00:00
nacin 0a21a349fb Fix typo in php comment. props Utkarsh, fixes #14072.
git-svn-id: http://svn.automattic.com/wordpress/trunk@15325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-06-25 06:26:40 +00:00
ryan a00f656cbc Fix current page detection for home when index.php is in the requested URL. Props filosofo. fixes #13977 for 3.1
git-svn-id: http://svn.automattic.com/wordpress/trunk@15320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-06-24 17:39:29 +00:00
nacin b7ac72a92b Assign menu-item-home also when menu item isn't current. props filosofo, see #14053 for trunk.
git-svn-id: http://svn.automattic.com/wordpress/trunk@15302 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-06-22 22:05:43 +00:00
ryan 15bbb301b4 Remove trailing whites
git-svn-id: http://svn.automattic.com/wordpress/trunk@15259 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-06-14 23:39:35 +00:00
ryan 59362ab139 Menu ancestor fixes. Props filosofo. fixes #12812
git-svn-id: http://svn.automattic.com/wordpress/trunk@15257 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-06-14 21:19:55 +00:00
ryan 5ecd1f31f2 Trim trailing whitespace.
git-svn-id: http://svn.automattic.com/wordpress/trunk@15235 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-06-11 20:19:35 +00:00
wpmuguru d956d4ba27 add ancestor classes for taxonomy objects, props filosofo, fixes #13831
git-svn-id: http://svn.automattic.com/wordpress/trunk@15221 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-06-11 16:00:29 +00:00
ryan f46ce5e7bc Allow assigning an empty menu to a location. fixes #13787
git-svn-id: http://svn.automattic.com/wordpress/trunk@15184 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-06-09 22:05:27 +00:00
ryan 17129fb62e Cut 'em out, move 'em on, trailing whitespace
git-svn-id: http://svn.automattic.com/wordpress/trunk@15116 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-06-02 20:04:07 +00:00
nacin 60bc51c308 Add menu_id to wp_nav_menu() and move container_id to the container. Set the container arg to false to not use a container. fixes #13669
git-svn-id: http://svn.automattic.com/wordpress/trunk@15113 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-06-02 17:04:07 +00:00
ryan 0dd1323350 Consolidate nav menu class assignments. Props filosofo. fixes #13664
git-svn-id: http://svn.automattic.com/wordpress/trunk@15105 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-06-02 13:48:26 +00:00
nacin a57f8861e6 Move the Walker_Nav_Menu_Checklist class to admin/includes.
git-svn-id: http://svn.automattic.com/wordpress/trunk@15077 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-05-31 15:47:53 +00:00
nacin 44b9c9812f Remove vestigial 'context' code for wp_nav_menu. This was used when we used to use the same function as a theme template tag and admin template function (now we don't.) fixes #13656.
git-svn-id: http://svn.automattic.com/wordpress/trunk@15075 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-05-31 14:54:50 +00:00
ryan b68acfa6b3 Unique menu container ids. Props filosofo. fixes #13597
git-svn-id: http://svn.automattic.com/wordpress/trunk@15034 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-05-28 16:32:57 +00:00
nacin da7b990fb5 Move the "Add Home Link" functionality to a checkbox on the View All tab of the Pages metabox. Also makes it work non-JS. props filosofo, fixes #13213.
git-svn-id: http://svn.automattic.com/wordpress/trunk@14971 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-05-27 02:24:33 +00:00