{"id":26127,"date":"2011-05-23T08:00:00","date_gmt":"2011-05-23T08:00:00","guid":{"rendered":"https:\/\/www.weixiaoduo.com\/plugins\/2024\/02\/22\/boones-sortable-columns\/"},"modified":"2011-05-27T08:19:00","modified_gmt":"2011-05-27T08:19:00","slug":"boones-sortable-columns","status":"publish","type":"post","link":"https:\/\/www.weixiaoduo.com\/plugins\/boones-sortable-columns\/","title":{"rendered":"Boone's Sortable Columns"},"content":{"rendered":"<p>Here\u2019s how I recommend using the class.<\/p>\n<ol>\n<li>Either activate this plugin, or include the class in your own plugin file.<\/li>\n<li>When you start to render the page with the post list, define some columns and then instantiate the class:<br \/>\n$cols = array(<br \/>\n    array(<br \/>\n        \u2018name\u2019      => \u2018restaurant_name\u2019,<br \/>\n        \u2018title\u2019     => \u2018Restaurant Name\u2019,<br \/>\n        \u2018css_class\u2019 => \u2018restaurant-name\u2019,<br \/>\n        \u2018is_default\u2019    => true<br \/>\n    ),<br \/>\n    array(<br \/>\n        \u2018name\u2019      => \u2018cuisine_type\u2019,<br \/>\n        \u2018title\u2019     => \u2018Cuisine Type\u2019,<br \/>\n        \u2018css_class\u2019 => \u2018cuisine-type\u2019,<br \/>\n        \u2018default_order\u2019 => \u2018desc\u2019<br \/>\n    )<br \/>\n);<br \/>\n$sortable = new BBG_CPT_Sort( $cols );<\/li>\n<li>As you render your table, you can use all sorts of fun methods to create column headers. Example:<\/li>\n<\/ol>\n<p>        have_columns() ) : ?><br \/>\n            have_columns() ) : $sortable->the_column() ?><\/p>\n<th class=\"the_column_css_class() ?>\u201d><br \/>\n                    <a href=\"the_column_next_link( \u2018url\u2019 ) ?>\u201d>the_column_title() ?><\/a><\/p>\n<p>        \u2026<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A handy, extensible class for adding sortable columns your custom post type lists.<\/p>\n","protected":false},"author":65,"featured_media":244315,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"Boone's Sortable Columns - \u8587\u6653\u6735\u63d2\u4ef6\u76ee\u5f55","description":"A handy, extensible class for adding sortable columns your custom post type lists."},"footnotes":""},"categories":[1],"tags":[1011,744,535],"class_list":["post-26127","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-columns","tag-custom-post-types","tag-tables"],"_links":{"self":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts\/26127","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/users\/65"}],"replies":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/comments?post=26127"}],"version-history":[{"count":0,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts\/26127\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/media\/244315"}],"wp:attachment":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/media?parent=26127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/categories?post=26127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/tags?post=26127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}