Ticket #5844 (closed defect (bug): fixed)

Opened 4 years ago

Last modified 4 years ago

remove extra <ul> in walker class

Reported by: hailin Owned by: anonymous
Priority: normal Milestone: 2.5
Component: General Version: 2.5
Severity: normal Keywords:
Cc:

Description (last modified by lloydbudd) (diff)

As reported by James R Whitehead of interconnectit.com on wp-hackers:

I'm wondering why the html generated by wp_list_pages and wp_list_categories has changed in the current 2.4-bleeding. I know things in this are not set in stone so I'm hoping it's not a permanent change as it makes coding CSS menus that work with 2.3 and 2.4 very difficult especially as child item are no longer in a single container. The new structure also makes less sense semantically as each child is now a separate UL.

Changed from:

<ul>

<li>

Text <ul>

<li>text</li> <li>text</li> <li>text</li>

<ul>

</li>

</ul>

To:

<ul>

<li>

Text <ul>

<li>text</li>

<ul> <ul>

<li>text</li>

<ul> <ul>

<li>text</li>

<ul>

</li>

</ul>

Attachments

5844_walker_ul.diff Download (2.5 KB) - added by hailin 4 years ago.
new patch

Change History

  • Version set to 2.5
  • Description modified (diff)
  • Milestone changed from 2.6 to 2.5

comment:2   ryan4 years ago

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

(In [6835]) Walker markup fixes from hailin. fixes #5844

comment:3   ryan4 years ago

  • Status changed from closed to reopened
  • Resolution fixed deleted

Looks like this is causing some problems with the depth arg.

comment:4   ryan4 years ago

(In [6839]) Revert [6835] as it breaks the depth arg. see#5844

hailin4 years ago

new patch

the issue is that when $depth = 1, it creates empty <ul> </ul>. The new patch addresses that: it checks earlier so it won't descend another level if not necessary. Verified with blogs with depth=1 theme (mwlibrary.wordpress.com).

comment:6   ryan4 years ago

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

(In [6858]) Walker markup fixes from hailin. fixes #5844

Note: See TracTickets for help on using tickets.