public static function get_current_url($remove_query = false)
    {
        global $wp;

        if ($remove_query === true) {
            return \trailingslashit(\home_url($wp->request));
        }

        return \home_url(\add_query_arg(null, null));
    }
public static function get_current_url($remove_query = false)
    {
        global $wp;

        if ($remove_query === true) {
            return \trailingslashit(\home_url($wp->request));
        }

        return \home_url(\add_query_arg(null, null));
    }
public static function get_current_url ( $ remove_query = false ) { global $ wp ; if ( $ remove_query === true ) { return \ trailingslashit ( \ home_url ( $ wp -> request ) ) ; } return \ home_url ( \ add_query_arg ( null , null ) ) ; }
Gets the current full URL of the page with query string, host, and scheme.

@param  boolean $remove_query If true, the URL is returned without any query params.
@return string The current URL.
Gets the current full URL of the page with query string host and scheme .