| @@ -22,9 +22,9 @@ | ||
| 22 | 22 | /** |
| 23 | 23 | * @var ThemeBuilder |
| 24 | 24 | */ |
| 25 | 25 | private $builder; |
| 26 | - | |
| 26 | + | |
| 27 | 27 | private $location_cache = []; |
| 28 | 28 | |
| 29 | 29 | public function __construct( $builder ) { |
| 30 | 30 | $this->cache = new Cache(); |
| @@ -243,8 +243,13 @@ | ||
| 243 | 243 | $is_passed = $sub_condition->check( [ 'id' => $sub_id ] ); |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | if ( $is_passed ) { |
| 247 | + // Get the post ID in the current language | |
| 248 | + if($template_id_locale = apply_filters( 'wpml_object_id', $template_id )){ | |
| 249 | + $template_id = $template_id_locale; | |
| 250 | + } | |
| 251 | + | |
| 247 | 252 | $post_status = get_post_status( $template_id ); |
| 248 | 253 | |
| 249 | 254 | if ( $post_status !== 'publish' ) { |
| 250 | 255 | continue; |