Skip to content

Commit

Permalink
Set unclassified published posts to Article
Browse files Browse the repository at this point in the history
  • Loading branch information
dshanske committed Jun 23, 2018
1 parent 4403942 commit c460c46
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion includes/class-kind-taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions includes/class-kind-view.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
}
Expand Down

0 comments on commit c460c46

Please sign in to comment.