| @@ -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(); |
| @@ -30,11 +30,11 @@ | ||
| 30 | 30 | $this->cache = new Cache(); |
| 31 | 31 | $this->builder = $builder; |
| 32 | 32 | |
| 33 | 33 | add_action( 'wp_loaded', [ $this, 'register' ] ); |
| 34 | - // add_action( 'wp_ajax_templately_conditions', [ $this, 'get_conditions' ] ); | |
| 35 | - // add_action( 'wp_ajax_templately_save_conditions', [ $this, 'save_conditions' ] ); | |
| 36 | - // add_action( 'wp_ajax_templately_check_conditions', [ $this, 'check_conditions' ] ); | |
| 34 | + add_action( 'wp_ajax_templately_conditions', [ $this, 'get_conditions' ] ); | |
| 35 | + add_action( 'wp_ajax_templately_save_conditions', [ $this, 'save_conditions' ] ); | |
| 36 | + add_action( 'wp_ajax_templately_check_conditions', [ $this, 'check_conditions' ] ); | |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | public function get_conditions() { |
| 40 | 40 | $config = []; |
| @@ -243,13 +243,8 @@ | ||
| 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 | - | |
| 252 | 247 | $post_status = get_post_status( $template_id ); |
| 253 | 248 | |
| 254 | 249 | if ( $post_status !== 'publish' ) { |
| 255 | 250 | continue; |