ナビゲーションをスキップ

Open

Reported for: WPML Multilingual CMS 4.5.8

Topic Tags: Compatibility

Overview of the issue

If you are using Mailchimp for WordPress (MC4WP) with WPML and you go to WPMLTranslation Management, the Edit link points to a broken URL.

Workaround

Please, make a full backup of your site before proceeding.

  1. Open your theme functions.php file.
  2. Add the following code:
    add_filter( 'wpml_document_edit_item_link', 'document_edit_item_link', 10, 5 );
    
    function document_edit_item_link( $link, $text, $current_document, $prefix, $type ) {
    		
    	if ( "mc4wp-form" !== $type ) {
    		return $link;
    	} 
    
    	$query = [];
    	$query['page']      = 'mailchimp-for-wp-forms';
    	$query['view']      = 'edit-form';
    	$query['admin_bar'] = 1;
    	$query['form_id']   = $current_document->ID;
    	$query['lang']      = $current_document->language_code;
    
    	$url_parsed          = array();
    	$url_parsed['query'] = http_build_query( $query );
    
    	$url = http_build_url( get_admin_url( null, 'admin.php' ), $url_parsed );
    	$url = esc_url( $url, null, 'redirect' );
    	
    	return "<a href='$url'>$text</a>";
    }
    
    add_filter( 'wpml_document_view_item_link', 'document_view_item_link' , 10, 5 );
    
    function document_view_item_link( $link, $text, $job, $prefix, $type ) {
    	if ( "mc4wp-form" !== $type ) {
    		return $link;
    	} 
    
    	return '';
    }
    
    

8件の返信 へ “Mailchimp for WordPress (MC4WP) - Edit link from Translation Management returns a broken URL”

  1. It’s 2023. Why isn’t that code integrated into “MailChimp Multilingual” plugin?

    Also, it would be nice if you could rename your plugin to match the current name which is “MC4WP: Mailchimp for WordPress”. The plugin could be named: “MC4WP: Mailchimp for WordPress multilingual” in your download dashboard as it’s confusing.

    Thank you!

    • Thank you for your feedback Jean-François. This fix is already in our devs roadmap, we will keep this erratum updated.
      I’ll also communicate your suggestion regarding this add-on name confusion.
      Regards

      • Hello Andrés,

        I’m having the same problem and I tried to implement given code but it only ended up when I click on edit it redirects me to the plug-in as if I want to edit the form rather than translating it, would you let me know how is it possible to translate MailChimp forms.

        Best,

        • Hello there,
          Sure, you should be able to translate your forms from WPML > Translations.
          Keep in mind that this issue is only if you want to edit your original form in WPML > Translation Management.
          I hope it helps.

    • Hello again,
      As I mention in my previous response, MailChimp forms translations should be done in from WPML > Translations.
      If you can’t move forward, please open a chat in our assistance channel.
      Regards

  2. The same for me: I can find no way to create and edit a translation of the MC4WP module. Why is it so complicated?

    • Helo there,
      If you are still having issues translating your MC4WP module, please start a chat in our assistance channel.
      We will be happy to help you moving your translation project forward.
      Regards

返信を残す

トピックに関連した内容を心がけ、他の人に敬意を払ってください。この投稿に関連しない問題についてサポートが必要な場合は、サポートフォーラムを使用してチャットを開始するかチケットを提出してください。

これらのタグを使用できます:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>