Permalink
Browse files

Use default permalink if no $redirect_from exists

Props @danblaker for #50
  • Loading branch information...
1 parent a1c6bf8 commit 879d07224cf74afd054609f7d0890b73704360f4 @danielbachhuber danielbachhuber committed Feb 10, 2014
Showing with 5 additions and 0 deletions.
  1. +5 −0 safe-redirect-manager.php
View
5 safe-redirect-manager.php
@@ -944,6 +944,11 @@ public function filter_post_type_link( $permalink, $post ) {
if ( false !== strpos( $redirect_from, '*' ) )
return $permalink;
+ // Use default permalink if no $redirect_from exists - this prevents duplicate GUIDs
+ if ( empty( $redirect_from ) ) {
+ return $permalink;
+ }
+
return home_url( $redirect_from );
}
}

0 comments on commit 879d072

Please sign in to comment.