diff --git a/classes/models/class-post.php b/classes/models/class-post.php index 627b32d..d565cac 100644 --- a/classes/models/class-post.php +++ b/classes/models/class-post.php @@ -334,6 +334,14 @@ public function get_type() { return $this->type; } + /** + * @return mixed + */ + public function get_type_labels() { + $content = get_post_type_object( $this->type ); + return $content->labels->singular_name; + } + /** * @param string $to_ping */ diff --git a/classes/view/class-post-table.php b/classes/view/class-post-table.php index bee4c1c..1e93f9f 100644 --- a/classes/view/class-post-table.php +++ b/classes/view/class-post-table.php @@ -57,6 +57,9 @@ public function column_default( $post, $column_name ) { case 'post_modified': $value = call_user_func( array( $post, 'get_modified' ) ); break; + case 'post_type': + $value = $post->get_type_labels(); + break; default: $value = ''; } @@ -149,6 +152,12 @@ public function prepare_items() { 'sort_by' => 'post_title', 'pre_sorted' => false, ), + 'post_type' => array( + 'title' => 'Type', + 'sortable' => true, + 'sort_by' => 'post_type', + 'pre_sorted' => false, + ), 'post_modified' => array( 'title' => 'Modified', 'sortable' => true, @@ -167,4 +176,4 @@ public function extra_tablenav( $which ) { do_action( 'sme_edit_batch_extra_tablenav', $which ); } -} \ No newline at end of file +} diff --git a/templates/edit-batch.php b/templates/edit-batch.php index ae6b157..9dce88e 100644 --- a/templates/edit-batch.php +++ b/templates/edit-batch.php @@ -17,16 +17,21 @@ - + + + + + display(); ?> - - + + + - \ No newline at end of file +