- pre 2.0.44 commit;

This commit is contained in:
nikitasinelnikov
2019-04-14 21:26:04 +03:00
parent f0dd12b5d3
commit 99474abfd5
6 changed files with 909 additions and 868 deletions
+7 -2
View File
@@ -132,8 +132,13 @@ if ( ! class_exists( 'um\core\Permalinks' ) ) {
function get_current_url( $no_query_params = false ) {
//use WP native function for fill $_SERVER variables by correct values
wp_fix_server_vars();
$host = isset( $_SERVER['HTTP_HOST'] ) ? $_SERVER['HTTP_HOST'] : 'localhost';
//check if WP-CLI there isn't set HTTP_HOST, use localhost instead
if ( defined( 'WP_CLI' ) && WP_CLI ) {
$host = isset( $_SERVER['HTTP_HOST'] ) ? $_SERVER['HTTP_HOST'] : 'localhost';
} else {
$host = $_SERVER['HTTP_HOST'];
}
$page_url = ( is_ssl() ? 'https://' : 'http://' ) . $host . $_SERVER['REQUEST_URI'];
if ( $no_query_params == true ) {