This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This thread is resolved. Here is a description of the problem and solution.

Problem: Only the wp-admin folder is hosted on a different subdomain. WPML doesn't recognize this and send calls to file which aren't on this subdomain

Solution: you need to edit the \wp-content\plugins\sitepress-multilingual-cms\classes\language-switcher\class-wpml-ls-assets.php file (see Relevant Documentation)

Relevant Documentation: https://wpml.org/forums/topic/wp-admin-is-on-restricted-subdomain-non-admin-pages-requests-wpml-from-wrong/#post-4200537

This topic contains 7 replies, has 2 voices.

Last updated by Laura 4 months ago.

Assigned support staff: Laura.

Author Posts
July 12, 2019 at 1:37 pm #4199361

williamB-15

our admin wordpresssite (wp-admin) is on restricted subdomain called hidden link

our public site hidden link is making wpml requests to admin.shl.com because of this custom setup.

How do we ensure wpml uses hidden link

/wp-content/plugins/sitepress-multilingual-cms/templates/language-switchers/legacy-dropdown-click/style.css
/wp-content/plugins/sitepress-multilingual-cms/templates/language-switchers/legacy-list-horizontal/style.css

Can we remove the domain, so the requests will be: (and work with my subdomains)
/wp-content/plugins/sitepress-multilingual-cms/templates/language-switchers/legacy-dropdown-click/style.css
/wp-content/plugins/sitepress-multilingual-cms/templates/language-switchers/legacy-list-horizontal/style.css

July 12, 2019 at 4:51 pm #4200537

williamB-15

this fixed my problem

\wp-content\plugins\sitepress-multilingual-cms\classes\language-switcher\class-wpml-ls-assets.php

    private function enqueue_template_resources( $slug, $template ) {
        $this->enqueued_templates[] = $slug;

        if ( $this->settings->can_load_script( $slug ) ) {
            foreach ( $template->get_scripts() as $k => $url ) {
				$url = str_replace( '//.site.com', '', $url );
                wp_enqueue_script( $template->get_resource_handler( $k ), $url, array(), $template->get_version() );
				//error_log( $url );
            }
        }

        if ( $this->settings->can_load_styles( $slug ) ) {
            foreach ( $template->get_styles() as $k => $url ) {
				$url = str_replace( '//.site.com', '', $url );
                wp_enqueue_style( $template->get_resource_handler( $k ), $url, array(), $template->get_version() );
				//error_log( $url );
            }
        }
    }
July 13, 2019 at 1:07 pm #4203539

Laura
Supporter

Languages: English (English ) Italian (Italiano ) Portuguese (Brazil) (Português )

Timezone: Europe/Rome (GMT+01:00)

Ok, so we can consider the issue as resolved?

July 16, 2019 at 6:43 pm #4223351

williamB-15

My issue is resolved now. Thank you!

July 16, 2019 at 6:54 pm #4223391

williamB-15

I see private data on this ticket.

Please remove admin.***.com from both of my posts.

July 17, 2019 at 7:40 am #4226689

Laura
Supporter

Languages: English (English ) Italian (Italiano ) Portuguese (Brazil) (Português )

Timezone: Europe/Rome (GMT+01:00)

Hi,

URLs are not visible on the public forum.

July 17, 2019 at 11:46 am #4229635

williamB-15

When I view this page with not logged in and in incognito mode, I sill see our domain in the above code I posted on JULY 12, 2019 AT 4:51 PM.

July 17, 2019 at 11:53 am #4229717

Laura
Supporter

Languages: English (English ) Italian (Italiano ) Portuguese (Brazil) (Português )

Timezone: Europe/Rome (GMT+01:00)

Hi,

the code is not private, and it was never private. Please remember this next time you open a support ticket if you do not wish to share URLs.