From bafd13a353f54c185ad410d88672e2676629de11 Mon Sep 17 00:00:00 2001 From: Marc Russell Date: Thu, 3 Sep 2015 15:29:17 -0400 Subject: [PATCH 1/3] Update UI of buttons. Pre-Flight which creates an active deployment moved first and set to primary blue so user can deploy. Secondary aspect of creating a batch to deploy later moved to second position. --- templates/edit-batch.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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 + From 6f6bd08a40a4345eeb45a630286be9fcfa0f6a08 Mon Sep 17 00:00:00 2001 From: Marc Russell Date: Thu, 3 Sep 2015 15:31:28 -0400 Subject: [PATCH 2/3] Include post type view in post table render. Help user experience by showing what post type in the list they are dealing with by default. --- classes/view/class-post-table.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 +} From 987048ea412962f965af0b37f9cacca96fba109e Mon Sep 17 00:00:00 2001 From: Marc Russell Date: Thu, 3 Sep 2015 15:32:55 -0400 Subject: [PATCH 3/3] Added support to pull friendly post type labels. --- classes/models/class-post.php | 8 ++++++++ 1 file changed, 8 insertions(+) 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 */