למשתמש זה אין נושאים מועדפים.
נושאי פורום מועדפים
נושאי פורום שנוצרו
| סטטוס |
נושא
|
תומך | קולות | פוסטים | עדכניות |
|---|---|---|---|---|---|
|
Pictures on BetterDocs secondary language article are replaced with original lnaguage pictures after…
1
2
נפתח על ידי: veikoK-2 ב: English Support |
|
1 | 19 | לפני יום 3, שעה 5 | |
|
WPML and BetterDocs does not like to work together
נפתח על ידי: veikoK-2
ב: English Support
Problem: wp-content/plugins/betterdocs/includes/Core/PostType.php . if (update_term_meta($term_id, '_docs_order', $docs_ordering_data)) {<br /> wp_send_json_success(__('Successfully updated.', 'betterdocs'));<br />}4. Replace it with: if (update_term_meta($term_id, '_docs_order', $docs_ordering_data)) {<br /> // WPML Integration: Sync taxonomies after order change<br /> if (class_exists('SitePress') && class_exists('WPML_Term_Translation_Utils')) {<br /> $docs_array = isset($_POST['docs_ordering_data']) && is_array($_POST['docs_ordering_data'])<br /> ? array_map('intval', $_POST['docs_ordering_data'])<br /> : explode(',', $docs_ordering_data);<br /> $this->wpml_sync_posts_taxonomies($docs_array);<br /> }<br /> wp_send_json_success(__('Successfully updated.', 'betterdocs'));<br />}5. Add the following helper function at the end of the class around line 1130, before the final '}': /**<br /> * WPML Integration: Sync post taxonomies across translations<br /> * @param array $post_ids Array of post IDs to sync<br /> */<br />private function wpml_sync_posts_taxonomies($post_ids) {<br /> global $sitepress;<br /> if (!$sitepress || empty($post_ids)) return;<br /><br /> $sync = new \WPML_Term_Translation_Utils($sitepress);<br /><br /> foreach ($post_ids as $post_id) {<br /> $trid = $sitepress->get_element_trid($post_id, 'post_docs');<br /> if (!$trid) continue;<br /><br /> $translations = $sitepress->get_element_translations($trid, 'post_docs');<br /> $original_id = $post_id;<br /><br /> foreach ($translations as $translation) {<br /> if (isset($translation->original) && $translation->original == 1) {<br /> $original_id = $translation->element_id;<br /> break;<br /> }<br /> }<br /><br /> foreach ($sitepress->get_active_languages() as $lang => $details) {<br /> $sync->sync_terms($original_id, $lang);<br /> }<br /> }<br />}If this solution does not resolve your issue or seems irrelevant due to updates or different circumstances, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, please open a new support ticket with us for further assistance. |
|
0 | 16 | לפני שבוע 1, יום 1 | |
|
When I update a translation (BetterDocs articel), the images in the translated article are replaced …
נפתח על ידי: veikoK-2 ב: Chat Support |
|
1 | 2 | לפני שבוע 1, יום 3 |