PluginProbe
VikBooking Hotel Booking Engine & PMS / 1.8.16
VikBooking Hotel Booking Engine & PMS v1.8.16
1.8.16 1.8.15 1.8.14 1.8.13 1.8.12 1.8.11 1.8.10 1.8.9 1.8.6 1.8.7 1.8.8 trunk 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 All 37 releases
← All changes | libraries/adapter/application/route.php +20 -0 1.6.7 → 1.8.16 View file →
@@ -190,8 +190,28 @@
190 190 {
191 191 // if the post ID is set, get the permalink directly
192 192 if ($post_id)
193 193 {
194 + /**
195 + * Added support to WPML, since it is unable to properly obtain the
196 + * correct permalink depending the requested language tag.
197 + *
198 + * @since 10.1.55
199 + */
200 + $wpml_post_lang = apply_filters('wpml_post_language_details', null, $post_id);
201 +
202 + /**
203 + * Make sure we haven't received an error object from WPML.
204 + *
205 + * @since 10.1.60
206 + */
207 + if ($wpml_post_lang && !is_wp_error($wpml_post_lang))
208 + {
209 + // WPML supported, go ahead
210 + return apply_filters('wpml_permalink', get_permalink($post_id), $wpml_post_lang['language_code']);
211 + }
212 +
213 + // WPML not supported, fallback to the default behavior
194 214 return get_permalink($post_id);
195 215 }
196 216
197 217 // otherwise get the current permalink