WPML

Overview of the Issue

When using AffiliateWP with the AffiliateWP Portal addon and WPML, the Affiliate Portal page settings (Affiliate Area, Login, and Registration pages) reset when switching between languages in the WordPress admin. Assigning pages in the secondary language causes the settings for the default language to be cleared, and vice versa.

Workaround

This issue is fixed. Updating to the latest version solves it on your site, so you only need this workaround if you can’t update yet.

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

  • Go to AffiliateWPSettingsAffiliates in the default language and resave all your page settings.
  • Then add the following code to your theme’s functions.php file.
    add_filter( 'affwp_affiliate_area_page_id', function( $affiliate_page_id ) {
        if ( class_exists('Sitepress') ) {
            $affiliate_page_id = apply_filters( 'wpml_object_id', $affiliate_page_id, 'page', true );
        }
        return $affiliate_page_id;
    }, 10, 1 );

Still Seeing This Issue?

If updating doesn’t fix it, ask a support question and we’ll look into it with you.

Ask a support question

All known issues