plugin-icon

Boone's Sortable Columns

作者:Boone Gorges·
A handy, extensible class for adding sortable columns your custom post type lists.
版本
1.1
活跃安装
10
最后更新
May 27, 2011

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() ?>

免费使用Business套餐
通过安装,您同意 WordPress.com 服务条款第三方插件条款
目前已测试版本
WordPress 3.2.1
这个插件是可用的下载,适用于您的站点。