[WordPress] 外掛分享: Boone’s Sortable Columns

首頁外掛目錄 › Boone's Sortable Columns
10+
安裝啟用
尚無評分
5410 天前
最後更新
問題解決
WordPress 3.1+ v1.1 上架:2011-05-22

內容簡介

以下是我推薦使用此類別的方式:

啟用這個外掛,或者將這個類別包含在你自己的外掛檔案中。
當你開始渲染包含文章清單的頁面時,定義一些欄位,然後實例化這個類別:

$cols = array(
array(
‘name’ => ‘restaurant_name’,
‘title’ => ‘餐廳名稱’,
‘css_class’ => ‘restaurant-name’,
‘is_default’ => true
),
array(
‘name’ => ‘cuisine_type’,
‘title’ => ‘美食類型’,
‘css_class’ => ‘cuisine-type’,
‘default_order’ => ‘desc’
)
);
$sortable = new BBG_CPT_Sort( $cols );
當你渲染表格時,你可以使用各種有趣的方法來創建列標。例如:

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

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.1) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Boone's Sortable Columns」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Here’s how I recommend using the class.

Either activate this plugin, or include the class in your own plugin file.
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 );
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() ?>

延伸相關外掛

文章
Filter
Apply Filters
Mastodon