diff --git a/eth-simple-shortlinks.php b/eth-simple-shortlinks.php index 048c6d8a79f99ae97199b75119119e75aa2636e2..556cf9cc26fcfd152a026f873fceab354461efa4 100644 --- a/eth-simple-shortlinks.php +++ b/eth-simple-shortlinks.php @@ -123,6 +123,10 @@ class ETH_Simple_Shortlinks { return $shortlink; } + if ( ! in_array( get_post_status( $id ), array( 'publish', 'future' ) ) ) { + return $shortlink; + } + return user_trailingslashit( home_url( sprintf( '%s/%d', $this->slug, $id ) ) ); } }