[UIXPRESS] WP_CLI Not working

WP_CLI is not working when UIXPRESS is enabled.

Bug is in file : uixpress/admin/src/Pages/FrontEnd.php

because of that :

private static function current_url() {
 $protocol = is_ssl() ? "https://" : "http://";
return $protocol . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
}

HTTP_HOST doesn't exists in the context of the WP_CLI, here is the fix :

private static function current_url() {
 if (!defined('WP_CLI') && isset($_SERVER['HTTP_HOST'])) {
 $protocol = is_ssl() ? "https://" : "http://";
return $protocol . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
}
}

Please authenticate to join the conversation.

Upvoters
Status

Completed

Board

πŸ› Bug Reports

Date

Over 1 year ago

Author

Tanguy Magnaudet

Subscribe to post

Get notified by email when there are changes.