[wp-trac] [WordPress Trac] #21766: modify body_class function to allow non-class items

WordPress Trac wp-trac at lists.automattic.com
Fri Sep 7 17:49:38 UTC 2012


#21766: modify body_class function to allow non-class items
-----------------------------------+------------------------------
 Reporter:  norcross               |       Owner:
     Type:  feature request        |      Status:  new
 Priority:  normal                 |   Milestone:  Awaiting Review
Component:  General                |     Version:  trunk
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |
-----------------------------------+------------------------------

Comment (by markjaquith):

 I will deny having written this:

 {{{
 <?php

 class WP_Body_Class_Injection_Plugin {
         public function __construct(){
                 add_filter( 'body_class', array( $this, 'body_class' ) );
         }

         public function body_class( $classes ) {
                 $backtrace = debug_backtrace();
                 if ( $backtrace[4]['function'] === 'body_class' )
                         echo " foo='bar' ";
                 return $classes;
         }
 }

 new WP_Body_Class_Injection_Plugin;
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21766#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list