From 257c46b8e05ffcba9205b974da19579f532a7327 Mon Sep 17 00:00:00 2001 From: Lain Vineyard Date: Sun, 9 Oct 2022 20:50:51 -0700 Subject: [PATCH] correct typo in find_and_update_post() to properly compare post slug and link url when updating IDX pages --- idx/idx-pages.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/idx/idx-pages.php b/idx/idx-pages.php index 2d42c60f1..0890c9d45 100755 --- a/idx/idx-pages.php +++ b/idx/idx-pages.php @@ -325,9 +325,9 @@ public function find_and_update_post( $link, $name, $posts ) { $matchingPostWithName = null; foreach ( $matchingPosts as $matchingPost ) { // It's possible for a post to already have the expected post name (slug), if we find one with this characteristic it should be kept over others - $nameMatches = $matchingPost->name == $link->url; + $nameMatches = $matchingPost->post_name == $link->url; if ($nameMatches) { - error_log("impress find_and_update_post found a matching post for $link, $name: " . $matchingPost->ID); + error_log("impress find_and_update_post found a matching post for $link->url, $name: " . $matchingPost->ID); $matchingPostWithName = $matchingPost; } }