Plugin Directory

Changeset 2927248


Ignore:
Timestamp:
06/17/2023 01:49:20 AM (3 years ago)
Author:
insiderealestate
Message:

Version 2.3.13

Location:
kvcore-idx/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kvcore-idx/trunk/includes/kvcore/class-api.php

    r2927244 r2927248  
    137137    const MULTIPLE_VALUE_FILTERS = ['options', 'propertyViews', 'propertyTypes', 'styles', 'buildingStyles', 'keywords'];
    138138
     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
    139161    public static function request( $method, $endpoint, $body = null, $includeFeaturedAgent = null, $asArray = false, $isListingDetail = false ) {
    140162        if ( is_array( $body ) ) {
     
    178200            // TODO: all calls should start handling it in array format not stdclass
    179201            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);
    181204            }
    182205            if (strpos($url, 'public/listings') !== false && $asArray) {
  • kvcore-idx/trunk/kvcore-idx.php

    r2927244 r2927248  
    1717 * Plugin URI:        kvcore-idx
    1818 * 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.12
     19 * Version:           2.3.13
    2020 * Author:            Inside Real Estate
    2121 * Author URI:        https://insiderealestate.com/kvcore/
     
    3333
    3434if( ! defined( 'KVCORE_IDX_PLUGIN_VERSION' ) ) {
    35     define( 'KVCORE_IDX_PLUGIN_VERSION', '2.3.12' );
     35    define( 'KVCORE_IDX_PLUGIN_VERSION', '2.3.13' );
    3636}
    3737
Note: See TracChangeset for help on using the changeset viewer.