| @@ -6,8 +6,13 @@ | ||
| 6 | 6 | if ( ! defined( 'ABSPATH' ) ) { |
| 7 | 7 | exit; |
| 8 | 8 | } |
| 9 | 9 | |
| 10 | +// This class integrates with WPML's documented hook API (wpml_post_language_details, | |
| 11 | +// wpml_element_trid, wpml_get_element_translations, etc.). Those hook names are owned | |
| 12 | +// by WPML and must be used verbatim, so the plugin-prefix rule does not apply here. | |
| 13 | +// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound | |
| 14 | + | |
| 10 | 15 | /** |
| 11 | 16 | * Helpers for round-tripping WPML language data through BetterDocs |
| 12 | 17 | * export / import. WPML stores per-post language data in `icl_translations`, |
| 13 | 18 | * which the regular WXR / CSV export doesn't touch — so without this layer |
| @@ -190,8 +195,9 @@ | ||
| 190 | 195 | 'name' => $slug, |
| 191 | 196 | 'post_type' => $post_type, |
| 192 | 197 | 'post_status' => 'any', |
| 193 | 198 | 'posts_per_page' => 1, |
| 199 | + // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.SuppressFilters_suppress_filters -- intentional: bypass WPML's own query filters to resolve the untranslated source post and avoid recursion in the WPML support layer. | |
| 194 | 200 | 'suppress_filters' => true, |
| 195 | 201 | ] ); |
| 196 | 202 | return ! empty( $posts ) ? $posts[0] : null; |
| 197 | 203 | } |