Skip to content

Commit

Permalink
Issue with detail page permalink when Yoast SEO is active - FIXED
Browse files Browse the repository at this point in the history
  • Loading branch information
kprajapatii committed Jul 12, 2018
1 parent 4ac4e94 commit 7d59c1c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions change_log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ v1.6.29
iframe api generation broken (by Google iframe restrictions) changed to new window popup - FIXED
Apple devices use different kind of apostrophe which does not work for search - FIXED
Fieldset title with special characters outputs incorrect css class - FIXED
Issue with detail page permalink when Yoast SEO is active - FIXED

v1.6.28
OpenStreetMap populates wrong region for UK - FIXED
Expand Down
5 changes: 4 additions & 1 deletion geodirectory-functions/general_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1286,7 +1286,10 @@ function geodir_breadcrumb() {
$location_link = $post_type_for_location_link;

if ( geodir_is_page( 'detail' ) || geodir_is_page( 'listing' ) ) {
global $post;
global $post, $gd_cache_post;
if ( ! empty( $post ) && ! empty( $gd_cache_post ) && geodir_is_page( 'detail' ) && $post->ID == $gd_cache_post->ID && ! isset( $post->country_slug ) && isset( $gd_cache_post->country_slug ) && geodir_disable_yoast_seo_metas() ) {
$post = $gd_cache_post;
}
$location_manager = defined( 'POST_LOCATION_TABLE' ) ? true : false;
$neighbourhood_active = $location_manager && get_option( 'location_neighbourhoods' ) ? true : false;

Expand Down
3 changes: 2 additions & 1 deletion geodirectory-functions/taxonomy_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1454,7 +1454,7 @@ function geodir_listing_permalink_structure($post_link, $post_obj, $leavename, $
//echo $post_link."<br />".$sample ;


global $wpdb, $wp_query, $plugin_prefix, $post, $comment_post_cache, $gd_permalink_cache;
global $wpdb, $wp_query, $plugin_prefix, $post, $comment_post_cache, $gd_permalink_cache, $gd_cache_post;
if (isset($post_obj->ID) && isset($post->ID) && $post_obj->ID == $post->ID) {
if($post_obj->post_status == 'auto-draft' || $post_obj->post_status == 'draft' || $post_obj->post_status == 'pending'){return $post_link;}
} elseif (isset($post_obj->post_status) && ($post_obj->post_status == 'auto-draft' || $post_obj->post_status == 'draft' || $post_obj->post_status == 'pending')) {
Expand Down Expand Up @@ -1704,6 +1704,7 @@ function geodir_listing_permalink_structure($post_link, $post_obj, $leavename, $
if (isset($orig_post)) {
$post = $orig_post;
}
$gd_cache_post = $post;

return $post_link;
}
Expand Down

0 comments on commit 7d59c1c

Please sign in to comment.