BACK TO DIRECTORY

Boone's Sortable Columns

by Boone Gorges

0.0
(0 ratings)

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(
    array(
    ‘name’ => ‘restaurant_name’,
    ‘title’ => ‘Restaurant Name’,
    ‘css_class’ => ‘restaurant-name’,
    ‘is_default’ => true
    ),
    array(
    ‘name’ => ‘cuisine_type’,
    ‘title’ => ‘Cuisine Type’,
    ‘css_class’ => ‘cuisine-type’,
    ‘default_order’ => ‘desc’
    )
    );
    $sortable = new BBG_CPT_Sort( $cols );
  3. As you render your table, you can use all sorts of fun methods to create column headers. Example:

have_columns() ) : ?>
have_columns() ) : $sortable->the_column() ?>
<th class="the_column_css_class() ?>”>
<a href="the_column_next_link( ‘url’ ) ?>”>the_column_title() ?>

Plugin Details

Active Installs
10
Total Downloads
2,994
Version
1.1
Requires WP
3.1
Requires PHP
Tested Up To
3.2.1
Added
2011-05-23
Last Updated
2011-05-27 12:19am GMT

Ratings

5
0
4
0
3
0
2
0
1
0