Plugin Directory

Test out the new Plugin Directory and let us know what you think.
!This plugin hasn’t been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

Boone's Sortable Columns

A handy, extensible class for adding sortable columns your custom post type lists.

Here's how I recommend using the class.

  1. Either activate this plugin, or include the class in your own plugin file.
  2. When you start to render the page with the post list, define some columns and then instantiate the class:
$cols = array(
        'name'        => 'restaurant_name',
        'title'       => 'Restaurant Name',
        'css_class'   => 'restaurant-name',
        'is_default'  => true
        'name'        => 'cuisine_type',
        'title'       => 'Cuisine Type',
        'css_class'   => 'cuisine-type',
        'default_order' => 'desc'
$sortable = new BBG_CPT_Sort( $cols );
  1. As you render your table, you can use all sorts of fun methods to create column headers. Example:
<table class="widefat">
    <?php if ( $sortable->have_columns() ) : ?>
        <?php while ( $sortable->have_columns() ) : $sortable->the_column() ?>
            <th class="<?php $sortable->the_column_css_class() ?>">
                <a href="<?php $sortable->the_column_next_link( 'url' ) ?>"><?php $sortable->the_column_title() ?></a>
        <?php endwhile ?>
    <?php endif ?>


Requires: WordPress 3.1 or higher
Compatible up to: WordPress 3.2-beta
Last Updated: 6 years ago
Active Installs: 10+


0 out of 5 stars


Got something to say? Need help?


Not enough data

0 people say it works.
0 people say it's broken.