Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#8671 closed enhancement (wontfix)

add slug as class name in wp_list_pages

Reported by: blonkm Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.7
Component: General Keywords: css class wp_list_pages
Focuses: Cc:


We can very simply add an optional class name to all links in wp_list_pages (and other hierarchies) using the following

classes.php, line 1163

$css_class .= ' ' . $page->post_name;

Attachments (1)

classes.php (44.9 KB) - added by blonkm 7 years ago.
improved classes.php

Download all attachments as: .zip

Change History (5)

7 years ago

improved classes.php

#1 @johnbillion
7 years ago

If this was implemented the classname would need a prefix, probably something like page-item- .

#2 @blonkm
7 years ago

My suggestion would be either this, or preferably to have a filter on this line so plugins and others can decide what to do with the link as it is processed. Right now the only available filter is wp_list_pages, so that is after the whole list is generated, which would make it quite hard (not impossible though) to add the class names.

#3 @ryan
7 years ago

  • Milestone changed from 2.7.1 to 2.8

#4 @Denis-de-Bernardy
7 years ago

  • Milestone 2.8 deleted
  • Resolution set to wontfix
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.