WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#7914 closed defect (bug) (fixed)

wp_page_menu different results from echo and other parameters

Reported by: MichaelH Owned by:
Milestone: 2.7 Priority: high
Severity: normal Version: 2.7
Component: Template Keywords:
Focuses: Cc:

Description

When using the wp_page_menu template tag, not sure what the 'echo' parameter is intended to produce. Used in conjunction with 'title_li' and 'show_home' even more questions...

These both cause slightly different results, but shouldn't echo=0 display nothing?:

wp_page_menu('echo=1')

wp_page_menu('echo=0')

This shows the title at the top of the list, the pages, then Home as the last page listed:

wp_page_menu('title_li=Title for wp_page_menu&echo=1&show_home=1')

This shows Home, then the title, then the rest of the pages:

wp_page_menu('title_li=Title for wp_page_menu&echo=0&show_home=1')

This shows the list of pages with Home at the end:

wp_page_menu('echo=1&show_home=1')

This shows Home followed by the remaining pages:

wp_page_menu('echo=0&show_home=1')

Using 2.7-almost-beta updated ~ 9am EST this date

Reference: ticket:7698

Attachments (1)

7914.diff (613 bytes) - added by MichaelH 5 years ago.
Delete title_li, make echo=true and sort_column=post_title to be consistent with wp_list_pages

Download all attachments as: .zip

Change History (7)

comment:1 ryan5 years ago

  • Milestone changed from 2.8 to 2.7

[7914] fixes echo.

I think wp_page_menu() needs to do its own title_li handling instead using wp_list_pages() title_li.

comment:2 ryan5 years ago

  • Priority changed from normal to high

comment:3 ryan5 years ago

[9245] fixes echo, not 7914.

comment:4 ryan5 years ago

(In [9246]) wp_page_menu() echo fixes. see #7914

comment:5 ryan5 years ago

That should fix the echo. It also removes title_li support. I'm not sure that's useful here.

MichaelH5 years ago

Delete title_li, make echo=true and sort_column=post_title to be consistent with wp_list_pages

comment:6 ryan5 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [9254]) Tweak wp_page_menu() defaults. Props MichaelH. fixes #7914

Note: See TracTickets for help on using tickets.