Make WordPress Core

Opened 4 years ago

Last modified 2 months ago

#10968 assigned enhancement

Add container_element arg to wp_page_menu()

Reported by: stebbiv Owned by: paulwilde
Milestone: Future Release Priority: lowest
Severity: minor Version:
Component: Posts, Post Types Keywords: good-first-bug has-patch
Focuses: template Cc:


I have added a new argument to the wp_page_menu template tag so it replaces the container div with another HTML element.

This is useful when migrating to HTML 5 and you want to use the <nav> element.

Attachments (2)

post-template.php.diff (1.5 KB) - added by stebbiv 4 years ago.
A simplified diff. Now container_element simply defaults to 'div'
wp_page_menu-container.diff (1.7 KB) - added by paulwilde 3 months ago.

Download all attachments as: .zip

Change History (13)

comment:1 scribu4 years ago

You forgot to replace the </div>

comment:2 scribu4 years ago

  • Summary changed from A new argument to replace the container div in wp_page_menu to Add container_element arg to wp_page_menu()

comment:3 stebbiv4 years ago

I have updated the diff file.

comment:4 stebbiv4 years ago

  • Cc stebbiv@… added

stebbiv4 years ago

A simplified diff. Now container_element simply defaults to 'div'

comment:5 scribu4 years ago

  • Keywords has-patch added
  • Milestone changed from Unassigned to 2.9

comment:6 ryan4 years ago

  • Milestone changed from 2.9 to Future Release

comment:7 johnbillion3 months ago

  • Keywords needs-refresh good-first-bug added; has-patch removed
  • Priority changed from normal to lowest
  • Severity changed from normal to minor

comment:8 paulwilde3 months ago

Refreshed patch.

I've opted for "menu_element" rather than "container_element", as container suggest a separate container outside of the menu when compared to wp_nav_menu.

comment:9 paulwilde3 months ago

  • Keywords has-patch added; needs-refresh removed

comment:10 nacin2 months ago

  • Component changed from Template to Posts, Post Types
  • Focuses template added

comment:11 nacin2 months ago

  • Owner set to paulwilde
  • Status changed from new to assigned
Note: See TracTickets for help on using tickets.