This thread is resolved. Here is a description of the problem and solution.
Problem:
You are encountering a PHP warning related to the WPML plugin, specifically an 'Undefined array key "REQUEST_METHOD"' error. This issue occurs in non-browser contexts such as WP-CLI commands, scheduled cron jobs, or when custom code triggers certain WPML functions outside of a normal page load.
Solution:
To address this issue temporarily, you can modify your custom code to set the 'REQUEST_METHOD' in the $_SERVER superglobal before WPML functions are called. Here is how you can do it:
<?php<br />$_SERVER['REQUEST_METHOD'] = 'GET';<br /><br />// ... rest of the script.
We have already reported this issue to our developers, and a fix will be included in future versions of the plugin.
If this solution does not resolve your issue or seems irrelevant due to being outdated or not applicable to your case, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If further assistance is needed, please open a new support ticket at WPML support forum.
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 topic contains 3 replies, has 1 voice.
Last updated by 4 months, 1 week ago.
Assisted by: Dražen.