Commit Graph

137 Commits

Author SHA1 Message Date
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
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