Open PixelbarEupen opened 7 years ago
Actually i got a better (not perfect) approach:
/* WPML Fix */ if ( defined( 'ICL_SITEPRESS_VERSION' ) ){ $wpml = maybe_unserialize( get_option('icl_sitepress_settings') ); if( ! $wpml['urls']['directory_for_default_language'] ) { global $sitepress; $url = $sitepress->convert_url( $url, $sitepress->get_default_language() ); } } /* WPML Fix */
When I enable "directory for default language" in WPML, aq_resize fails to resize images because it can't find the image. The error log says:
Aq_Resize.process() error: Image must be local: URL
It is because WPML rewrites the image url to
http://sitedomain/LANGAUGE_CODE/wp-content/uploads/image.jpg
.I added a small fix in the WPML-Fix in the aq_resize script:
/* WPML Fix */ if ( defined( 'ICL_SITEPRESS_VERSION' ) ){ global $sitepress; if( ICL_LANGUAGE_CODE !== $sitepress->get_default_language() ) { $url = $sitepress->convert_url( $url, $sitepress->get_default_language() ); } } /* WPML Fix */
This solution works for me.