[wp-trac] [WordPress Trac] #17727: page_css_class - pass additional parameters to filter

WordPress Trac wp-trac at lists.automattic.com
Wed Jun 8 19:22:57 UTC 2011


#17727: page_css_class - pass additional parameters to filter
--------------------------+-----------------------------
 Reporter:  TheDeadMedic  |      Owner:
     Type:  enhancement   |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Template      |    Version:
 Severity:  minor         |   Keywords:
--------------------------+-----------------------------
 Brought to light in a [http://wordpress.stackexchange.com/q/11821/1685
 question asked WordPress Answers.SE], the task was to add a class
 {{{parent}}} to all pages that had children.

 The solution was to extend {{{Walker_Page}}}, and then call the parent
 method, so as to have access to the arguments passed to it.

 It would've been a lot easier if the filter {{{page_css_class}}} also
 passed these arguments, namely {{{$args}}} and {{{$depth}}}.

 With this in place, I can see it opening up a realm of possibilities for
 custom CSS classes with ease!

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17727>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list