Make WordPress Core

Opened 18 years ago

Closed 18 years ago

#8671 closed enhancement (wontfix)

add slug as class name in wp_list_pages

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

Description

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 18 years ago.
improved classes.php

Download all attachments as: .zip

Change History (5)

@blonkm
18 years ago

improved classes.php

#1 @johnbillion
18 years ago

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

#2 @blonkm
18 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
18 years ago

  • Milestone 2.7.1 → 2.8

#4 @Denis-de-Bernardy
18 years ago

  • Milestone 2.8
  • Resolution → wontfix
  • Status new → closed
Note: See TracTickets for help on using tickets.