[wp-trac] [WordPress Trac] #21539: category_description filter not applied to Description field on Categories page

WordPress Trac wp-trac at lists.automattic.com
Fri Aug 10 15:10:23 UTC 2012


#21539: category_description filter not applied to Description field on Categories
page
----------------------------+------------------------------
 Reporter:  StephenCronin   |       Owner:
     Type:  enhancement     |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Administration  |     Version:  3.4.1
 Severity:  minor           |  Resolution:
 Keywords:  has-patch       |
----------------------------+------------------------------

Comment (by SergeyBiryukov):

 A workaround would be to hook into `get_terms` filter on that screen:
 {{{
 function filter_category_descriptions_in_admin( $terms ) {
         global $current_screen;

         if ( empty( $current_screen ) || 'edit-category' !=
 $current_screen->id )
                 return $terms;

         foreach ( $terms as $key => $term )
                 $terms[ $key ]->description = apply_filters(
 'category_description', $term->description );

         return $terms;
 }
 add_filter( 'get_terms' , 'filter_category_descriptions_in_admin' );
 }}}

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


More information about the wp-trac mailing list