[wp-trac] [WordPress Trac] #26580: Add filters to WP_MS_Sites_List_Table::prepare_items()

WordPress Trac noreply at wordpress.org
Mon Jul 28 12:37:06 UTC 2014


#26580: Add filters to WP_MS_Sites_List_Table::prepare_items()
--------------------------------+-----------------------------
 Reporter:  csixty4             |       Owner:
     Type:  enhancement         |      Status:  new
 Priority:  normal              |   Milestone:  Future Release
Component:  Networks and Sites  |     Version:
 Severity:  normal              |  Resolution:
 Keywords:  needs-patch         |     Focuses:  multisite
--------------------------------+-----------------------------

Comment (by lenasterg):

 Hi.
 In the attached file I imported a simple filter  "wpmu_blogs_orderby' in
 prepare_items() function. This way at least a custom column made be a
 plugin  can be sortable.
 Example usage:
 Sort a custom column created from a plugin  which shows the "deleted"
 field of wp_blogs

 {{{
 add_filter( 'wpmu_blogs_orderby' , 'mycustom_column_orderby' ) ;

 function mycustom_column_orderby( $order_by ) {
     if ( $order_by == 'deleted' ) {
         $query = 'ORDER BY deleted ' ;
         return $query ;
     } else {
         return null ;
     }
 }
 }}}


 What do you think about this solution?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/26580#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list