Forums › Forums › Search & Filter Pro › Getting current URL
Tagged: current url, url
- This topic has 6 replies, 2 voices, and was last updated 8 years, 2 months ago by Anonymous.
-
Anonymous(Private) October 24, 2016 at 7:52 pm #66079
Hello,
I believe after updating to a new version I am getting only a part of current URL of the search results page.
For example,
http://bestweave.org/?sfid=14046&_sfm_width=5+6&_sfm_height=7+8&_sfm_sale_price=0+36873
gets only http://bestweave.org/?sfid=14046 when I am trying to e-mail results page. It was working fine before.Here is a function that I use for getting current page URL:
global $wp;
$url = add_query_arg( $wp->query_string, ”, home_url( $wp->request ) );Any idea on what can cause this problem?
Thanks for your time!
Trevor(Private) October 25, 2016 at 10:12 am #66220Our forum parsing software might have mangled that, as in the middle you have one double quote mark, but it should be two singles.
However, that method is not reliable for all query strings.
AFAIK the recommended WordPress method is this:
$url = home_url( add_query_arg( NULL, NULL ) );
Assuming you want the full relative path included.
Trevor(Private) October 25, 2016 at 7:34 pm #66420Well, we are not sure why the code did work and now does not, nor do we know if S&F is the cause. Nor can we think of any other way to get the URL (the plugin does not do that). The only thin I could find was this:
http://stackoverflow.com/questions/6768793/get-the-full-url-in-php/8891890#8891890
Other than that, we are out of ideas, sorry.
-
AuthorPosts