Changeset 2927248
- Timestamp:
- 06/17/2023 01:49:20 AM (3 years ago)
- Location:
- kvcore-idx/trunk
- Files:
-
- 2 edited
-
includes/kvcore/class-api.php (modified) (2 diffs)
-
kvcore-idx.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kvcore-idx/trunk/includes/kvcore/class-api.php
r2927244 r2927248 137 137 const MULTIPLE_VALUE_FILTERS = ['options', 'propertyViews', 'propertyTypes', 'styles', 'buildingStyles', 'keywords']; 138 138 139 public static function replaceStringInObject($object, $search, $replace) { 140 // Check if the given object is an array 141 if (is_array($object)) { 142 // Iterate over each element in the array 143 foreach ($object as $key => $value) { 144 // Recursively call the function for each element 145 $object[$key] = replaceStringInObject($value, $search, $replace); 146 } 147 } elseif (is_object($object)) { 148 // If the given object is an object, iterate over its properties 149 foreach ($object as $key => $value) { 150 // Recursively call the function for each property value 151 $object->$key = replaceStringInObject($value, $search, $replace); 152 } 153 } elseif (is_string($object)) { 154 // If the given object is a string, replace the search string with the replace string 155 $object = str_replace($search, $replace, $object); 156 } 157 158 return $object; 159 } 160 139 161 public static function request( $method, $endpoint, $body = null, $includeFeaturedAgent = null, $asArray = false, $isListingDetail = false ) { 140 162 if ( is_array( $body ) ) { … … 178 200 // TODO: all calls should start handling it in array format not stdclass 179 201 if (strpos($url, 'public/listings') !== false && $isListingDetail === true) { 180 return json_decode(strip_tags(stripslashes($response['body'])), $asArray); 202 $response = self::replaceStringInObject(wp_remote_retrieve_body($response), '\u0000*\u0000items', 'items'); 203 return json_decode($response); 181 204 } 182 205 if (strpos($url, 'public/listings') !== false && $asArray) { -
kvcore-idx/trunk/kvcore-idx.php
r2927244 r2927248 17 17 * Plugin URI: kvcore-idx 18 18 * Description: Integrates seamlessly with kvCORE to bring the power of IDX search, high conversion lead capture, and much more to your WordPress site. 19 * Version: 2.3.1 219 * Version: 2.3.13 20 20 * Author: Inside Real Estate 21 21 * Author URI: https://insiderealestate.com/kvcore/ … … 33 33 34 34 if( ! defined( 'KVCORE_IDX_PLUGIN_VERSION' ) ) { 35 define( 'KVCORE_IDX_PLUGIN_VERSION', '2.3.1 2' );35 define( 'KVCORE_IDX_PLUGIN_VERSION', '2.3.13' ); 36 36 } 37 37
Note: See TracChangeset
for help on using the changeset viewer.