Opened 8 months ago
Closed 8 months ago
#22331 closed defect (bug) (fixed)
show_home not working on wp_page_menu
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.5 |
| Component: | Bundled Theme | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: |
Description
As reported here, this function call doesn't returns the expected output:
wp_page_menu( array( 'show_home' => 'Hjem', 'sort_column' => 'menu_order' ) );
Looks like show_home is being ignored. It keeps outputting "Home" instead of the custom text and even setting it as false doesn't behave as expected.
If the filter wp_page_menu_args is used, wp_page_menu works correctly.
Tested in WordPress 3.4.2 and 3.5-beta2, no active plugins, using TwentyEleven.
Attachments (2)
Change History (6)
SergeyBiryukov
— 8 months ago
comment:1
SergeyBiryukov
— 8 months ago
- Component changed from General to Bundled Theme
- Keywords has-patch added
- Milestone changed from Awaiting Review to 3.5
comment:2
kovshenin
— 8 months ago
22331.2.patch uses isset instead of empty which also allows 'show_menu' => false with wp_page_menu.
comment:3
SergeyBiryukov
— 8 months ago
Good call, thanks.
comment:4
lancewillett
— 8 months ago
- Owner set to lancewillett
- Resolution set to fixed
- Status changed from new to closed
In 22359:
The culprit is twentyeleven_page_menu_args() (twentytwelve_page_menu_args() in Twenty Twelve).
It ignores any passed value and enforces true instead:
http://core.trac.wordpress.org/browser/tags/3.4.2/wp-content/themes/twentyeleven/functions.php#L372
22331.patch is a fix for all three themes.