From 8c84b86c62c4008abdb1ea22ee2164ed4975b03d Mon Sep 17 00:00:00 2001 From: "simon.brown" Date: Thu, 9 Jul 2015 16:37:48 +1000 Subject: [PATCH] Resolving issue with custom post type and preview link being generated prior to save when a taxonomy needs to be part of a url but is not yet selected --- wp-permastructure.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-permastructure.php b/wp-permastructure.php index 1eb71cd..34fde53 100644 --- a/wp-permastructure.php +++ b/wp-permastructure.php @@ -337,7 +337,7 @@ public function parse_permalinks( $post_link, $post, $leavename, $sample = false $permalink = home_url( str_replace($rewritecode, $rewritereplace, $permalink) ); $permalink = user_trailingslashit($permalink, 'single'); } else { // if they're not using the fancy permalink option - $permalink = home_url('?p=' . $post->ID); + $permalink = home_url('?post_type='.$post->post_type.'&p=' . $post->ID); } return $permalink;