- סטטוס
- נפתר
- דווח עבור
- WPML Multilingual for CF7 1.2.1
- נפתר בגרסה
- Contact Form 7 Multilingual 1.2.2
- תוסף/ערכת עיצוב קשורים
- Contact Form 7
- תגיות נושא
- Compatibility
סקירה כללית של התקלה
בעת הוספת טפסים באמצעות התוסף Contact Form 7 ופונקציית ה־PHP do_shortcode(), הטפסים אינם מופיעים מתורגמים כצפוי.
פתרון עוקף
ודא שיש לך גיבוי מלא של האתר לפני שתמשיך.
- פתח את הקובץ …/wp-content/plugins/contact-form-7-multilingual/classes/shortcodes.php.
- חפש את שורה 21.
- החלף את:
public function translate_shortcode_form_id( $atts ) { $form = null; if ( ! empty( $atts['id'] ) ) { $form = wpcf7_contact_form( (int) $atts['id'] ); } if ( ! $form && ! empty( $atts['title'] ) ) { $form = wpcf7_get_contact_form_by_title( trim( $atts['title'] ) ); unset( $atts['title'] ); } if ( $form ) { $atts['id'] = apply_filters( 'wpml_object_id', $form->id(), Constants::POST_TYPE, true ); } return $atts; } - בקוד הבא:
public function translate_shortcode_form_id( $atts ) { $form = null; if ( ! empty( $atts['id'] ) && is_numeric($atts['id']) ) { $form = wpcf7_contact_form( (int) $atts['id'] ); } if ( ! $form && ! empty( $atts['title'] ) ) { $form = wpcf7_get_contact_form_by_title( trim( $atts['title'] ) ); unset( $atts['title'] ); } if ($form == null){ $form = wpcf7_get_contact_form_by_hash( $atts['id']); } if ( $form ) { $atts['id'] = apply_filters( 'wpml_object_id', $form->id(), Constants::POST_TYPE, true ); } return $atts; }