Target By URL Stops Working After Upgrade to 1.3.2
-
Hi,
We have a website that’s been installed as a subdomain of our main website. We’ve been using Widget Context 1.0.5 for ages and its been working great! I recently got around to upgrading to version Widget Context 1.3.2 and noticed that the Target By URL stopped working on our subdomain web site.
I’ve tracked down the problem to the following code in WidgetContext.php:
protected function get_request_path() {
static $path;if ( ! isset( $path ) ) {
$path = $this->path_from_uri( $_SERVER[‘REQUEST_URI’] );
}return $path;
It turns out this code returns the path based on the top level website and not the path based on the subdomain website. That is, it returns the path with the subdomain directory at the beginning of the path.
Patching the code as follows fixed our problem with our subdomain website. I realize it breaks support for queries but since we aren’t using them in our website this seemed like the quickest fix for us.
protected function get_request_path() {
static $path;if ( ! isset( $path ) ) {
global $wp;
$path = $wp->request;
}return $path;
Is it possible to get this issue properly fixed in a future version of Widget Context so it once again supports subdomain websites?
Thanks
- The topic ‘Target By URL Stops Working After Upgrade to 1.3.2’ is closed to new replies.