fix: destination cards show a tour photo again

vc_term_image_url() cached empty results for 12h and relied on an SQL
meta comparison to find a tour with a photo; destination cards site-wide
(homepage and region pages) were blank. Read the photo in PHP from up to
10 tours (primary, else first gallery image), use a fresh cache key, and
expire empty results after an hour. Plugin 1.9.3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-29 16:47:01 +03:30
parent 98e706477c
commit fd6dba3203
4 changed files with 21 additions and 15 deletions

View File

@@ -102,7 +102,7 @@ class VC_Taxonomies {
} else {
update_term_meta( $term_id, '_vc_image_url', $url );
}
delete_transient( 'vc_term_img_' . absint( $term_id ) );
delete_transient( 'vc_term_img2_' . absint( $term_id ) );
}
public static function register() {