From c460c4645cc3a60963aef0a1ba91a43ade0c4995 Mon Sep 17 00:00:00 2001 From: David Shanske Date: Sat, 23 Jun 2018 10:17:43 -0500 Subject: [PATCH] Set unclassified published posts to Article --- includes/class-kind-taxonomy.php | 7 ++++++- includes/class-kind-view.php | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/includes/class-kind-taxonomy.php b/includes/class-kind-taxonomy.php index 19cc4d8..1d4e058 100755 --- a/includes/class-kind-taxonomy.php +++ b/includes/class-kind-taxonomy.php @@ -220,7 +220,12 @@ public static function select_metabox( $post ) { if ( isset( $_GET['kind'] ) ) { $default = get_term_by( 'slug', $_GET['kind'], 'kind' ); } else { - $default = get_term_by( 'slug', get_option( 'kind_default' ), 'kind' ); + // On existing published posts without a kind fall back on article which most closely mimics the behavior of an unclassified post + if ( 'publish' === get_post_status( $post ) ) { + $default = get_term_by( 'slug', 'article', 'kind' ); + } else { + $default = get_term_by( 'slug', get_option( 'kind_default' ), 'kind' ); + } } $terms = get_terms( 'kind', array( diff --git a/includes/class-kind-view.php b/includes/class-kind-view.php index 3a74f5a..7427767 100644 --- a/includes/class-kind-view.php +++ b/includes/class-kind-view.php @@ -385,9 +385,9 @@ public static function read_text( $type ) { return ''; } $read = array( - 'to-read' => __( 'Want to Read: ', 'indieweb-post-kinds' ), - 'reading' => __( 'Reading: ', 'indieweb-post-kinds' ), - 'finished' => __( 'Finished Reading: ', 'indieweb-post-kinds' ), + 'to-read' => __( 'Want to Read: ', 'indieweb-post-kinds' ), + 'reading' => __( 'Reading: ', 'indieweb-post-kinds' ), + 'finished' => __( 'Finished Reading: ', 'indieweb-post-kinds' ), ); return $read[ $type ]; }