I have recently acquired a new client and migrated his website from the original developers hosting to his own hosting. Prior to transferring to the new hosting, the site was working fine. However, now i get the following error:
Fatal error: Can't use function return value in write context in /home/agingtree/public_html/dev/wp-content/themes/aging-tree/lib/vendor.php on line 55
Nothing has been modified other than the db to reflect the new domain and location etc. Here is the code around the issue that is showing. Any help is appreciated:
/*
* Vendor Query Vars
*/
add_filter('query_vars', 'vendor_query_vars');
function vendor_query_vars($vars){
$vars[] = "vendor";
$vars[] = "service-category";
$vars[] = "service-subcategory";
$vars[] = "city";
$vars[] = "zip";
return $vars;
}
/*
* Vendor API Cache
*/
add_action('pre_get_posts', 'vendor_api_cache');
function vendor_api_cache(){
if (!empty (get_query_var('vendor'))):
$data = api_get('vendor',['id' => get_query_var('vendor')]);
if(!empty($data[0])){
$vendor = $data[0];
}
else{
$vendor = null;
}
wp_cache_set('vendor',$vendor);
endif;
}