Commit Graph

160 Commits

Author SHA1 Message Date
Drew Jaynes 5415629ad2 Nav Menus: Move the `Walker_Nav_Menu` class to its own file.
The new class-walker-nav-menu.php file is loaded in nav-menu-template.php for backward compatibility purposes.

Fixes #37035. See #33413.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37608 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-06 15:18:31 +00:00
Drew Jaynes 2c7f5217cd Docs: Relocate some `@see` tags and add missing `@access` tags to method and property DocBlocks in `Walker_Nav_Menu`.
See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37607 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-06 05:47:27 +00:00
Drew Jaynes 16b51fb44d Docs: Reformat several parameter descriptions in `Walker_Nav_Menu` to directly reference `wp_nav_menu()` rather than use inline `@see` tags.
See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37606 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-06 05:45:28 +00:00
Drew Jaynes 318f745808 Docs: Correct DocBlock descriptions for the `$before`, `$after`, `$link_before`, and `$link_after` arguments for `wp_nav_menu()`.
* `$before` falls before the link markup starts
* `$after` falls after the link markup ends
* `$link_before` falls before the link text
* `$link_after` falls after the link text

Props wp_smith for the initial patch.

See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37529 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-25 16:17:27 +00:00
Drew Jaynes 9193013158 Docs: Apply inline `@see` tags to hooks referenced in DocBlocks in a variety of wp-includes/* files.
Applying these specially-crafted `@see` tags allows the Code Reference parser to recognize and link these elements as actions and filters.

Fixes #36921.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37512 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-23 19:02:28 +00:00
Drew Jaynes e78209267f Docs: Standardize filter docs in wp-includes/nav-menu-template.php to use third-person singular verbs per the inline documentation standards for PHP.
See #36913.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37468 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-22 18:28:27 +00:00
Drew Jaynes fe3b007fdd Docs: Remove inline `@see` tags from function, class, and method references in inline docs.
Known functions, classes, and methods are now auto-linked in Code Reference pages following #meta1483.

Note: Hook references are still linked via inline `@see` tags due to the unlikelihood of reliably matching for known hooks based on a RegEx pattern.

See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37308 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-02 04:00:28 +00:00
Konstantin Obenland 6c54bf4dcb Menus: Bring back line break between menu items.
While removing line breaks was great for all use cases except justified menu
items, it broke menus with justified menu items.
Reverts [34321].

Props wp-architect.
Fixes #35107.


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


git-svn-id: http://core.svn.wordpress.org/trunk@36046 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-24 00:21:27 +00:00
Scott Taylor dc1e85a540 Nav Menus: show custom post type Archive item at the top of the `View All` tab for the post type on the legacy Nav Menu screen.
Props aaroncampbell, DrewAPicture, seanchayes, hlashbrooke, paulwilde, ericlewis, raulillana
See #16075.

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


git-svn-id: http://core.svn.wordpress.org/trunk@35346 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-24 17:46:25 +00:00
John Blackbourn 51667f882a Add a `nav_menu_item_title` filter for filtering nav menu item titles.
Fixes #33447
Props paulwilde

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


git-svn-id: http://core.svn.wordpress.org/trunk@34630 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-28 18:41:26 +00:00
Scott Taylor d6774f0f6d Nav Menus: in `wp_nav_menu()`, `$container` is already bound to a list of allowed tags. PHP, being its whimsical self, while return `true` if someone sets `$container` to `true` via `in_array( true, [ 'div', 'nav' ] )`. Check that `$container` is a string before the `in_array()` check. `'true'` does not pass.
Props shedonist for the original patch.
Fixes #32464.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34594 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-27 18:13:24 +00:00
John Blackbourn aa35e473f7 `callback` is not a valid type in PHP, PSR-5, or phpDocumentor. `callable` should be used instead.
Fixes #34032

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


git-svn-id: http://core.svn.wordpress.org/trunk@34530 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-25 23:58:25 +00:00
John Blackbourn cb740147be Add `$depth` as a parameter in the `nav_menu_item_args` filter.
Fixes #29417

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


git-svn-id: http://core.svn.wordpress.org/trunk@34471 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-24 17:59:24 +00:00
Drew Jaynes 90f61eff52 Docs: Add a summary to the hook doc for the `nav_menu_item_args` filter, introduced in [34471].
Fixes #29417.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34445 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-24 05:09:24 +00:00
Scott Taylor 0c1f92e301 Nav Menus: Add a 'nav_menu_item_args' filter to `Walker_Nav_Menu::start_el()`.
Props bjornjohansen.
Fixes #29417.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34435 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-24 03:17:24 +00:00
Konstantin Obenland 8d8252aa89 Menus: Remove whitespace between nav menu items.
Avoids CSS hacks like floating menu items or setting the parent element's
font-size to 0 in order to display nav menus horizontally.

Props jjeaton.
Fixes #27762.


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


git-svn-id: http://core.svn.wordpress.org/trunk@34285 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-19 11:40:26 +00:00
Sergey Biryukov 78d43de7e4 Avoid PHP notices in `redirect_canonical()` and `_wp_menu_item_classes_by_context()` if `$_SERVER['HTTP_HOST']` is not set.
fixes #32229.
Built from https://develop.svn.wordpress.org/trunk@33775


git-svn-id: http://core.svn.wordpress.org/trunk@33743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-28 03:31:20 +00:00
Weston Ruter 2678bd9225 Customizer: Restore default `fallback_cb` arg for `wp_nav_menu()` calls in customizer preview.
Props ocean90, westonruter.
Fixes #33218.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33552 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-04 21:57:25 +00:00
Dion Hulse ffb1de37ae Ensure that Custom Links in menu's are marked as current regardless of their scheme.
Props McGuive7, marsjaninzmarsa.
Fixes #32221

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


git-svn-id: http://core.svn.wordpress.org/trunk@33074 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-07 09:57:26 +00:00
Sergey Biryukov 52db28396c Customizer: Avoid PHP notices after [32806].
props adamsilverstein, westonruter.
fixes #32781.
Built from https://develop.svn.wordpress.org/trunk@33035


git-svn-id: http://core.svn.wordpress.org/trunk@33006 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-01 19:08:24 +00:00
Scott Taylor 0cc29d8bb7 In `wp_nav_menu()`, ensure that the `$menu` arg is populated when passed to filters.
Props greuben, chriscct7.
Fixes #16594.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32774 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-16 20:33:25 +00:00
Dominik Schilling 8dcd236ba3 Nav menus: Reset the `fallback_cb` default argument in `wp_nav_menu` in case of a Customizer preview.
props westonruter.
see #32576.
Built from https://develop.svn.wordpress.org/trunk@32763


git-svn-id: http://core.svn.wordpress.org/trunk@32734 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-14 17:14:24 +00:00
Scott Taylor cb0b0b109d Fix doc blocks for `nav-menu*.php` files.
See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32582 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-26 22:10:25 +00:00
Scott Taylor fc843ce4d0 There are some random `add_action()` and `add_filter()` calls littered around some files in `wp-includes/`. These should be moved to `wp-includes/default-filters.php` with the rest of the registered hooks. It seems like this was the best practice for awhile and then we randomly stopped. This file loads way before any of the includes, so the hooks will be registered for any request that loads WordPress, even `SHORTINIT` - a lot of the hooks registered won't run anyways (that's already the case).
See #30947.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31149 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-12 16:40:23 +00:00
Drew Jaynes c31f6c11e9 4.1 Docs Audit: Spell out HTML element names in DocBlock summaries for the `nav_menu_css_class`, `nav_menu_item_id`, and `nav_menu_link_attributes` filters.
Due to a recent clarification in the core inline documentation standards, HTML tags are no longer allowed in DocBlock summaries as they wreak havoc on displaying pages in the official Code Reference. See #30473.

See #30469.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30608 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-28 12:12:23 +00:00
John Blackbourn 8f219ed949 Revert [30032] so appropriate PHP warnings aren't masked.
Fixes #28743

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


git-svn-id: http://core.svn.wordpress.org/trunk@30582 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-28 01:29:23 +00:00
Drew Jaynes 9955384dbe Ensure inline code is markdown-escaped as such, HTML tags are removed from summaries, and that code snippets in descriptions are properly indented.
Affects DocBlocks for the following core elements:
* Backtick-escape an HTML tag in the description for the `media_upload_mime_type_links()` hook
* Backtick-escape inline code in the description for `wp_get_active_network_plugins()`
* Remove HTML tags from the summaries for the `nav_menu_css_class`, `nav_menu_item_id`, and `nav_menu_link_attributes` hooks
* Backtick-escape HTML tags, add inline `@see` tags to parameter descriptions for the `nav_menu_css_class`, `nav_menu_item_id`, and `nav_menu_link_attributes` hooks

Props rarst.
See #30473.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30532 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-24 05:53:22 +00:00
Drew Jaynes fd1f5bb3ad Update the DocBlock changelogs for the `nav_menu_css_class`, `nav_menu_item_id`, and `nav_menu_link_attributes` hooks following [30358], where `$depth` parameters were added.
Props kpdesign.
See [30358]. Fixes #19064.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30474 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-20 18:26:23 +00:00
John Blackbourn 96e57d411b Add `$depth` parameter to the `nav_menu_css_class`, `nav_menu_item_id`, and `nav_menu_link_attributes` filters.
Fixes #19064
Props cyclometh, chriscct7, johnbillion

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


git-svn-id: http://core.svn.wordpress.org/trunk@30357 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-16 07:37:22 +00:00
Mark Jaquith 11471d6415 Cast class names to an array to avoid a potential warning.
props briandichiara
fixes #29743
Built from https://develop.svn.wordpress.org/trunk@30032


git-svn-id: http://core.svn.wordpress.org/trunk@30032 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-26 23:19:19 +00:00
Sergey Biryukov 504d4ad5eb Change the default orderby value in wp_get_nav_menus() to 'name'.
props voldemortensen, igmoweb.
fixes #29460.
Built from https://develop.svn.wordpress.org/trunk@29792


git-svn-id: http://core.svn.wordpress.org/trunk@29564 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-29 15:45:16 +00:00
Scott Taylor 0005433983 Correct a few `@param` docs for `$walker`.
Props dnaber-de.
Fixes #29011.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29075 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-24 22:25:16 +00:00
Sergey Biryukov 819d4f972c Correct filter documentation in wp_nav_menu().
props dlh.
fixes #28657.
Built from https://develop.svn.wordpress.org/trunk@28867


git-svn-id: http://core.svn.wordpress.org/trunk@28667 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-27 03:37:16 +00:00
Scott Taylor cc0c90e05a When selecting a fallback menu in `wp_nav_menu()`, the "first" menu is retrieved from an unsorted query. When retrieving a fallback menu, pass `array( 'orderby' => 'name' )` to `wp_get_nav_menus()` to return a menu consistently.
Props lukecarbis.
Fixes #28126.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28630 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-24 17:25:15 +00:00
Scott Taylor dfa4de15fa Add missing access modifiers to methods/members in `Walker` and subclasses. Add a magic `__get()` method.
See #27881, #22234.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28340 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-19 06:00:15 +00:00
Scott Taylor 9a1dcd1a7c In `Walker_Nav_Menu::start_el()`, `$class_names` is set twice before it is used.
See #27882.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28158 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-06 21:33:14 +00:00
Helen Hou-Sandí 675a350ff9 Add the ability to short-circuit wp_nav_menu() via the `pre_wp_nav_menu` hook. props kasparsd, DrewAPicture, Rarst. fixes #23627.
Built from https://develop.svn.wordpress.org/trunk@27386


git-svn-id: http://core.svn.wordpress.org/trunk@27234 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-03 20:43:15 +00:00
Drew Jaynes cb8951b0b3 Remove all `@package` and `@subpackage` PHPDoc tags not at the file- or class-levels in core.
See #27200.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27119 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-02-25 17:14:14 +00:00
Andrew Nacin 9cc9b023b4 Remove unused variable.
props ericlewis.
fixes #27176.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27084 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-02-21 20:52:13 +00:00
Drew Jaynes de2bd0bf44 Fix reversed return logic in the `wp_nav_menu()` phpdoc.
See #27163.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-02-21 18:34:14 +00:00
Drew Jaynes 44696a60dc Convert docs for `wp_nav_menu()` arguments to a hash notation.
Fixes #27163.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27079 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-02-21 18:32:15 +00:00
Drew Jaynes 17248058f3 Fixes for hooks documentation wp-includes/nav-menu-template.php.
See #26869, #25229 and [25410].

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


git-svn-id: http://core.svn.wordpress.org/trunk@27058 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-02-20 05:08:13 +00:00
Drew Jaynes cd8cedc40d First there were two, and now there are three -- in the @since versions that came before and that shall be. And so it will be, says nacin.
Props JustinSainton, SergeyBiryukov, DrewAPicture.
Fixes #26713.

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


git-svn-id: http://core.svn.wordpress.org/trunk@26754 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-24 18:57:12 +00:00
Andrew Nacin 5361a8abca Spell out duplicate hook locations.
props DrewAPicture.
fixes #25658.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-24 22:59:20 +00:00
Andrew Nacin 8ae8e01b67 Remove the old wp_auto_updates_maybe_update cron event. Schedule the new wp_maybe_auto_update event at 7 a.m. and 7 p.m. in the site's timezone.
see #27704.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25825 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-24 22:53:14 +00:00
Andrew Nacin 74488bdcb0 Spell out duplicate hook locations.
props DrewAPicture.
fixes #25658.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25780 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-22 17:22:11 +00:00
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