Skip to content

Commit

Permalink
Fixes #887
Browse files Browse the repository at this point in the history
If you embed a view on a page with an Edit Entry link and use it, then decide you want to make the page the "Front Page" the Edit Entry link incorrectly points to the original URL instead of the front page URL.
  • Loading branch information
zackkatz committed Aug 17, 2017
1 parent fc9b14f commit 7328575
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions includes/class-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,10 @@ public static function directory_link( $post_id = NULL, $add_query_args = true )
// @since 1.3
$link = wp_cache_get( 'gv_directory_link_'.$post_id );

if( (int) $post_id === (int) get_option( 'page_on_front' ) ) {
$link = home_url();
}

if( empty( $link ) ) {

$link = get_permalink( $post_id );
Expand Down

0 comments on commit 7328575

Please sign in to comment.