get_req_data(); if ( $taxonomy ) { $ref_lang = $wpml_language_resolution->is_language_active($ref_lang) || $wpml_language_resolution->is_language_hidden($ref_lang) ? $ref_lang : $sitepress->get_default_language(); $corrections = $sync_helper->get_unsynced_elements( $taxonomy, $ref_lang ); wp_send_json_success( $corrections ); } else { wp_send_json_error( 'No taxonomy in request!' ); } } public function ajax_sync_save() { if ( !wpml_is_action_authenticated( 'wpml_tt_sync_hierarchy' ) ) { wp_send_json_error( 'Wrong Nonce' ); } $sync_helper = wpml_get_hierarchy_sync_helper( 'term' ); list( $taxonomy, $ref_lang ) = $this->get_req_data(); if ( $taxonomy ) { $sync_helper->sync_element_hierarchy( $taxonomy, $ref_lang ); wp_send_json_success( 1 ); } else { wp_send_json_error( 'No taxonomy in request!' ); } } }