haustauernblick
Forum Replies Created
Viewing 1 replies (of 1 total)
-
Forum: Plugins
In reply to: [Site Reviews] Own IDs instead of post_idHi! Thank you very much for pushing the update and the support so far. We started implementing the feature but still have the problem that the ratings and reviews don’t stick to chatbot_id in the assigned_terms. The programmer asked me to send this code:
public function site_reviews_terms($ttid, $term, $taxonomy) { if (!get_option('aietrs_reviews_enabled', 0) || !empty($ttid) || substr($term, 0, 10) !== 'chatbot_id') { return $ttid; } ie_log('AI Engine Translations',array('site_reviews_terms starting term:',$term)); $url = filter_input(INPUT_SERVER, 'REQUEST_URI'); $path = wp_parse_url($url, PHP_URL_PATH); $query = wp_parse_args(wp_parse_url($url, PHP_URL_QUERY)); $botId = strlen($term) > 10 ? explode('chatbot_id_',$term)[1] : $query['id']; if (!$botId) { ie_log('AI Engine Translations',array('[ERROR] site_reviews_terms no botId',$term,$path)); return $ttid; } ie_log('AI Engine Translations',array('site_reviews_terms botId:',$botId,$term)); $chatbot = $this->get_chatbot($botId); if (!$chatbot || !isset($chatbot['translations']) || empty($chatbot['translations'])) { ie_log('AI Engine Translations',array('site_reviews_terms no translation:',$botId,$term)); return $ttid; } $term = wp_create_term($botId, $taxonomy); if (is_wp_error($term)) { ie_log('AI Engine Translations',array('site_reviews_terms wp error:',$botId,$term)); return $ttid; } ie_log('AI Engine Translations',array('site_reviews_terms return term:',$term,$botId,$term['term_taxonomy_id'])); return $term['term_taxonomy_id'] ?? 0; } add_filter('site-reviews/assigned_terms/term_id', array($this, 'site_reviews_terms'), 10, 3);
It it’s helpful I can also send the link so that you can see the implementation…
Viewing 1 replies (of 1 total)