Dieser Benutzer hat keine Lieblingsthemen.
Bevorzugte Forumsthemen
Forumsthemen erstellt
Status |
Thema
|
Unterstützer | Stimmen | Beiträge | Frische |
---|---|---|---|---|---|
Canonical tag is not created
Angefangen von: alfredoR in: Soporte en español |
0 | 5 | Vor 6 Tage, 2 Stunden | ||
Have languages that are duplicates from others
Angefangen von: alfredoR
in: English Support
Problem: add_action( 'wp_insert_post', 'my_duplicate_on_publish' ); function my_duplicate_on_publish( $post_id ) { global $post; if (is_null($post) || (defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE) || (isset( $post->post_type ) && $post->post_type == 'revision')) { return $post_id; } remove_action( 'wp_insert_post', 'my_duplicate_on_publish' ); $is_translated_in_es_mx = apply_filters( 'wpml_element_has_translation', '', $post_id, 'es-mx' ); if ( !$is_translated_in_es_mx ) { do_action( 'wpml_admin_make_post_duplicates', $post_id ); do_action( 'wpml_set_element_language_details', [ 'element_id' => $post_id, 'element_type' => 'post_' . $post->post_type, 'trid' => wpml_get_content_trid( 'post_' . $post->post_type, $post_id ), 'language_code' => 'es-mx', 'source_language_code' => 'es' ] ); } add_action( 'wp_insert_post', 'my_duplicate_on_publish' ); return $post_id; } This script checks if a post is a new or updated Spanish post and duplicates it for Spanish (Mexico) if no translation exists. Modify the condition inside the function if you want to limit this behavior to specific post types. If this solution does not apply to your case, or if it seems outdated, please check the related known issues, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. If further assistance is needed, we encourage you to open a new support ticket. |
1 | 3 | Vor 1 Woche, 5 Tage | ||
Migrating from development site to production site
Angefangen von: alfredoR in: English Support |
2 | 6 | Vor 1 Monat | ||
Traducción Slider Revolution
Angefangen von: alfredoR in: Soporte en español |
2 | 2 | Vor 3 Jahren, 8 Monaten |